logstash input is elasticsearch and there is field called 'check' in input index.
when ever read the documents in this index need to increment check by 1.
I used ruby filter for this.
ruby{code => "event.set('check',[event.get('check_')].to_i + 1)"}
getting following error
[2019-12-09T18:48:30,925][ERROR][logstash.filters.ruby ] Ruby exception occurred: undefined method `to_i' for ["0"]:Array
Remove the square brackets around event.get('check_'). They turn it into an array and prevent .to_i working. Square brackets are used to reference fields in the logstash configuration, not in ruby.
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.