NXlog Exec $Hostname = hostname_fqdn(); not working

Tags:

#1 tobias42

Hi everybody,

stumbled over a problem that sometimes I get hostnames from nxlog other times it's fqdns. Happens only with internal nxlog messages.I tired to fix this by using the Exec $Hostname = hostname_fqdn(); statement.

# Nxlog internal logs
<Input internal>
   Module im_internal
   Exec $EventReceivedTime = integer($EventReceivedTime) / 1000000; to_json();
   Exec $Hostname = hostname_fqdn(); 
</Input>

Still get messages with designation nxlog: internal that have a source_host with hostname only and not fqdn.

Either I am missing something really obvious or something is broken. Any guidance to troubleshoot or figure out what is going on much appreciated

Best regards

Tobias

#2 b0ti Nxlog ✓
#1 tobias42
Hi everybody, stumbled over a problem that sometimes I get hostnames from nxlog other times it's fqdns. Happens only with internal nxlog messages.I tired to fix this by using the Exec $Hostname = hostname_fqdn(); statement. # Nxlog internal logs <Input internal>    Module im_internal    Exec $EventReceivedTime = integer($EventReceivedTime) / 1000000; to_json();    Exec $Hostname = hostname_fqdn();  </Input> Still get messages with designation nxlog: internal that have a source_host with hostname only and not fqdn. Either I am missing something really obvious or something is broken. Any guidance to troubleshoot or figure out what is going on much appreciated Best regards Tobias

> sometimes I get hostnames

I assume "sometimes" means on one host you get fqdn and on another the short form?

You didn't tell what the OS is but in any case NXLog only returns the value that it gets from the OS. You will need to properly configure the hostname of your system.