README

image i_github_com_jj_raku_syslog_parse_workflows__github_workflows_test_yml_badge_svg not found

NAME

Syslog::Parse - Creates a supply out of syslog entries

SYNOPSIS

use Syslog::Parse;

my $parser = Syslog::Parse.new;

$parser.parsed.tap: -> $v {
    say $v;
}

sleep( @*ARGS[0] // 120 );

Or

use Syslog::Parse;
my $parser = Syslog::Parse.new;
Promise.at(now+1).then: {
    shell "logger logging $_" for ^10;
};

react {
    whenever $parser.parsed -> %v {
        say %v;
        done(); # Just interested in the last one
    }
}

Also, you can run

watch-syslog.p6

which is going ot be installed along with the distribution.

DESCRIPTION

Syslog::Parse is a parser that extracts information from every line in /var/log/syslog. Creates two objects of the kind Supply: one (simply called .supply) that returns the raw lines, another, .parsed, which returns a structure with the following keys:

day # Day in the month
month # TLA of month
hour # String with hour
hostname # Hostname that produced it
actor # Who produced the message log
pid # Sometimes, it goes with a PID
message # Another data structure, with key message (the whole message) and
        # user if one has been identified

PLATFORMS

It works on platforms that use /var/log/syslog as a syslog file, with the same format. All Debian seem to be that way.

If you don't have that platform, you can still use the grammars on files with that format.

AUTHOR

JJ Merelo [email protected]

COPYRIGHT AND LICENSE

Copyright 2020 JJ Merelo

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

Syslog::Parse v0.0.3

Creates a supply out of syslog entries

Authors

  • JJ Merelo

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • Syslog::Grammar
  • Syslog::Grammar::Actions
  • Syslog::Message::Action
  • Syslog::Message::Grammar
  • Syslog::Parse
  • Syslog::Who::Action
  • Syslog::Who::Grammar

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.