Hi,
I have a Logstash script in which I have created some ruby functions. I have placed them at the beginning of my logstash filter so in this way, they are declared before they are called.
The script works fine when I run it using logstash-5.5.2 but when I try to run it using logstash-6.2.4, it starts giving me method undefined error which I can't seem to resolve.
Any help in this matter will be appreciated.
Thank you in anticipation.
Stuff inside code doesn't survive between different ruby filters. I think it'll work if you instead put it in the ruby filter's init option, but I don't understand why you're complicating things. What's the point of defining a function instead of just inlining the code in the ruby filter where you need the code?
I have a file which has almost 800 lines of code so inlining the code is not a good idea for me specially if I consider re-usability.
Yes, you are right. Stuff inside code doesn't survive between different ruby filters but what I don't understand is how it was working in the previous version of logstash.
Also, I tried it in init but it wasn't working so I had to use inline option.
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.