Use fqdn as host value

master
Daniel Berteaud 6 years ago
parent 2f988d0177
commit 419c00a1dd
  1. 4
      systemd-journal-gelf

@ -9,7 +9,7 @@ use Compress::Zlib;
use Getopt::Long; use Getopt::Long;
use YAML::Tiny; use YAML::Tiny;
use MIME::Base64; use MIME::Base64;
use Net::Domain qw(hostfqdn);
#### Global vars #### #### Global vars ####
@ -154,7 +154,7 @@ while ( my $entry = <JOURNAL> ){
my $gelf = { my $gelf = {
version => 1.1, version => 1.1,
short_message => $msg->{MESSAGE}, short_message => $msg->{MESSAGE},
host => $msg->{_HOSTNAME}, host => hostfqdn(),
timestamp => int ( $msg->{__REALTIME_TIMESTAMP} / ( 1000 * 1000 ) ), timestamp => int ( $msg->{__REALTIME_TIMESTAMP} / ( 1000 * 1000 ) ),
level => $msg->{PRIORITY} level => $msg->{PRIORITY}
}; };

Loading…
Cancel
Save