On a Windows machine, I'm currently trying to create a custom field named client_ip and grab the IP address of the sending client. This works, but when I switch IPs, nxlog keeps sending the old stale IP, not the new IP.
Exec $client_ip = string(host_ip());
But, if I restart the nxlog service on the Windows machine, it starts returning the new correct IP. I don't want to have to restart the service.
How can I make nxlog always resolve and return the current ip?
Or is there another way to grab the IP address and assign that to a custom field?