Parse

NAME

raku::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
    }
}

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

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.