Add hostname to the beginning of the log

Tags:

#1 Symphonia

I need to append a hostname to the beginning of the raw log because the log that is being transferred does not show the host who is forwarding the log. I need to add a hostname to identify the log is being forwarded.

Here is the output. How do I add the hostname?

<Input internal> Module im_internal Exec $Message = to_json(); </Input>

<Input cs> Module im_file File 'C:\fdr\out\data*.json' CloseWhenIdle TRUE DirCheckInterval 300 Recursive TRUE ReadFromLast FALSE <OnEOF> <Exec> file_remove(file_name ()); </Exec> Gnxlog </OnEOF>

</Input>

#2 rafDeactivated Nxlog ✓
#1 Symphonia
I need to append a hostname to the beginning of the raw log because the log that is being transferred does not show the host who is forwarding the log. I need to add a hostname to identify the log is being forwarded. Here is the output. How do I add the hostname? <Input internal> Module im_internal Exec $Message = to_json(); </Input> <Input cs> Module im_file File 'C:\fdr\out\data*.json' CloseWhenIdle TRUE DirCheckInterval 300 Recursive TRUE ReadFromLast FALSE <OnEOF> <Exec> file_remove(file_name ()); </Exec> Gnxlog </OnEOF> </Input>

Hey,

You can use for instance:

   Exec $Hostname = hostname_fqdn(); 

You can find more more information about core functions in the documentation.