I want create a new field based on an field from an JDBC input i want to use the filter option of Logstash but not sure the how to.
My goal is to have something like this:
new_field = substr(old_field,1,300) i want to extract the first 300 characters of the old field using for example the Grok filter...
How'd do that ?
I found the solution:
ruby { code => "event['dest-field'] = event['src-field'][0..2]" }
Credit to Magnus Bäck
In any version of logstash from recent years you will need to use event.get and event.set rather than refering to event as a hash.
© 2020. All Rights Reserved - Elasticsearch
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.