| 1 | package eris::dictionary::syslog; | ||||||||||
| 2 | # ABSTRACT: Contains fields extracted from syslog messages | ||||||||||
| 3 | |||||||||||
| 4 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | with qw( | |||||||||
| 7 | eris::role::dictionary::hash | ||||||||||
| 8 | ); | ||||||||||
| 9 | |||||||||||
| 10 | 1 | our $VERSION = '0.008'; # VERSION | |||||||||
| 11 | |||||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub _build_priority { 90; } | ||||||||
|
Subroutine
_build_priority: not called CC=1 SCAR=6.9
| |||||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | 1 | my $_hash=undef; | |||||||||
| 17 | sub hash { | ||||||||||
| 18 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
hash: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 19 | 0 | ▶ | return $_hash if defined $_hash; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 0 | my %data; | |||||||||
| 21 | 0 | ▶ | while(<DATA>) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 0 | chomp; | |||||||||
| 23 | 0 | my ($field,$def) = $self->expand_line($_); | |||||||||
| 24 | 0 | $data{$field} = $def; | |||||||||
| 25 | } | ||||||||||
| 26 | 0 | $_hash = \%data; | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | |||||||||||
| 30 | 1 | 1; | |||||||||
| 31 | |||||||||||
| 32 | =pod | ||||||||||
| 33 | |||||||||||
| 34 | =encoding UTF-8 | ||||||||||
| 35 | |||||||||||
| 36 | =head1 NAME | ||||||||||
| 37 | |||||||||||
| 38 | eris::dictionary::syslog - Contains fields extracted from syslog messages | ||||||||||
| 39 | |||||||||||
| 40 | =head1 VERSION | ||||||||||
| 41 | |||||||||||
| 42 | version 0.008 | ||||||||||
| 43 | |||||||||||
| 44 | =head1 SYNOPSIS | ||||||||||
| 45 | |||||||||||
| 46 | This dictionary contains elements extracted from the syslog header and | ||||||||||
| 47 | meta-data. | ||||||||||
| 48 | |||||||||||
| 49 | =head1 ATTRIBUTES | ||||||||||
| 50 | |||||||||||
| 51 | =head2 priority | ||||||||||
| 52 | |||||||||||
| 53 | Defaults to 90, or towards the end. | ||||||||||
| 54 | |||||||||||
| 55 | =for Pod::Coverage hash | ||||||||||
| 56 | |||||||||||
| 57 | =head1 SEE ALSO | ||||||||||
| 58 | |||||||||||
| 59 | L<eris::dictionary>, L<eris::role::dictionary> | ||||||||||
| 60 | |||||||||||
| 61 | =head1 AUTHOR | ||||||||||
| 62 | |||||||||||
| 63 | Brad Lhotsky <brad@divisionbyzero.net> | ||||||||||
| 64 | |||||||||||
| 65 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 66 | |||||||||||
| 67 | This software is Copyright (c) 2015 by Brad Lhotsky. | ||||||||||
| 68 | |||||||||||
| 69 | This is free software, licensed under: | ||||||||||
| 70 | |||||||||||
| 71 | The (three-clause) BSD License | ||||||||||
| 72 | |||||||||||
| 73 | =cut | ||||||||||
| 74 | |||||||||||
| 75 | __DATA__ | ||||||||||
| 76 | { "name": "timestamp", "type": "date", "description": "The timestamp encoded in the message" } | ||||||||||
| 77 | { "name": "message", "type": "text", "description": "Message contents, often truncated to relevance" } | ||||||||||
| 78 | severity Syslog severity of the message | ||||||||||
| 79 | facility Syslog facility of the message | ||||||||||
| 80 | program The program name or tag that generated the message | ||||||||||
| 81 | hostname The hostname as received by the syslog server | ||||||||||