i wanted to asked quickly if it is possible in logstash to execute a shell/bash command in the processing line of an event.
Background:
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?
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.
A forward lookup of an IP address? What do you mean? Does your IP address field sometimes contain a hostname? Or you want NetBIOS lookups rather than DNS lookups?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.