Adds a new field to the record (e.g. : [ “NewField” ] )
Fills in a default value (e.g. : [ “NewField” ] = “abc123” )
Returns the record back to Logstash
I’ve been Googling this for an hour or so, but just can’t begin to guess at the syntax here. The syntax for creating the field and then accessing it really confuses me. Can anyone throw me a line? Thank you!
Dumb follow-up question... When I look at my data records flowing through LS, I realize that I need new fields added, and I don't think I can code my LS filter {} section with the logic necessary to populate the data for those new fields. This is why I'm interested in LS passing all records off to an external Ruby script, and make Ruby do the hard work of modifying the records.
Is manipulating and modifying a LS data record beyond the capability of a Ruby script?
Would a better approach be for LS to hand Ruby a subset of the record's data, let Ruby do the fancy computations, wait for Ruby to return values, then let LS filter {} do a mutate + add_field to finish the job? Thank you!
No. A logstash ruby filter can contain almost any ruby code you can write. I do not see a reason to use an external script (in the sense of a separate process). The ruby code can get and set fields using the event API.
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.