line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Log::JSON::LogStash; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
40032
|
use Mojo::Base 'Mojo::Log::JSON'; |
|
1
|
|
|
|
|
1172
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
266
|
use Time::HiRes qw/ gettimeofday /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has default_fields => sub { |
10
|
|
|
|
|
|
|
{ '@version' => 1, |
11
|
|
|
|
|
|
|
'@timestamp' => sub { |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my ( $seconds, $microseconds ) = gettimeofday(); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my ( $sec, $min, $hour, $mday, $mon, $year ) = gmtime($seconds); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sprintf( |
18
|
|
|
|
|
|
|
"%04d-%02d-%02dT%02d:%02d:%02d.%06dZ", |
19
|
|
|
|
|
|
|
$year + 1900, |
20
|
|
|
|
|
|
|
$mon + 1, $mday, $hour, $min, $sec, $microseconds |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
}, |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |