line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Log::JSON::LogStash; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
85102
|
use Mojo::Base 'Mojo::Log::JSON'; |
|
1
|
|
|
|
|
1701
|
|
|
1
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
231
|
use Time::HiRes qw/ gettimeofday /; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
12
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
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__ |