i wanted to asked quickly if it is possible in logstash to execute a shell/bash command in the processing line of an event.
We wanted to add an field in our events, where an ip address get matched to the corresponding dns name.
So far i used the "Resolv.getname" ruby function to solve that problem, unfortunately this only performs an lookup in the reverse lookup zone of the dns server - if there is no ptr entry, this will not return the hostname.
While this is working for many of the ip addresses, a big bunch of them dont have an ptr entry at the dns server, so whats required is an forward lookup to still get the hostname of the device.
Looking at google, i didnt find any ruby gems that provide such an function, but i got an shell command "nmblookup -A" that would do the job quite good.
Can i somehow implement this in logstash to use this command at the time, an event get processed?