lib/eris/dictionary/syslog.pm

filter: Statementstmt 52.6% 10 / 19 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 1 totaltotal 42.8% 12 / 28 CC 3 SCAR 19.0
CC
3
Cov
43%
hash
12.0
_build_priority
2.0
BEGIN
1.0
CRAP 6.7
« script/eris-stdin-listener.pl ↑ Summary lib/eris/role/schema.pm »
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
BranchTrueFalseTotal
if defined $_hash 0 0 0
20 0 my %data;
21 0 ▶ while(<DATA>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline DATA)) 0 0 0
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
« script/eris-stdin-listener.pl ↑ Summary lib/eris/role/schema.pm »