Hi Guys, got a config setup as below to receive snmp walks result and I a script to clean the data.
However it fails to run because of an error on the ruby filter. I have tried my script on the output on irb and the script runs fin. Below is just a basic part of the script. Any idea what I could be doing wrong?
Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, {, } at line 12, column 38 (byte 316) after filter {\r\n ruby {\r\n code => "\r\n
Yes you are right the double quotes are a problem. I now get the a different error. But I believe is now is about how I handle the output of the walk. without filter I will normally get below result stored.
You should use gsub, not gsub!. For fields like host using gsub! will result in you trying to event.set(nil, ...), which is not what you want.
What an event contains depends on the input. For a file input it is by default one line of a file. For an snmp input which is walking a MIB it is all of the objects that were returned when the input polled the target.
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.