Adding field as source IP gateway address

Tags:

#1 JustasS

Hello, I need to add extra field to send External/gateway IP address to Graylog.

Using output UDP: <Output out> Module om_udp Host *** Port 4514 OutputType GELF Exec $hostname = 'test_SRV'; </Output>

Its even posible?

#2 NenadM Nxlog ✓ (Last updated )
#1 JustasS
Hello, I need to add extra field to send External/gateway IP address to Graylog. Using output UDP: <Output out> Module om_udp Host *** Port 4514 OutputType GELF Exec $hostname = 'test_SRV'; </Output> Its even posible?

Hello

Please elaborate on what's the External/gateway IP address is. Is that a value of the field that you collected via some input module? Do the original log messages contain the info about the gateway IP address? OR Is it a value that you need to collect from the OS (via bash or PowerShell) and insert it into the custom field called $GatewayIP? In your example, you set the $hostname field value to constant - 'test_SRV'. Custom fields can be added by using the NXLog language and an Exec directive, and if your Gateway IP is a constant, then just add an Exec block:

Exec $GatewayIP = 'XYZ.XYZ.XYZ.XYZ';