,defining different format spec for each of the log files in the overall group of log files ...
Now I need to take this in the logstash filter and use it for new variables / fields; I can reference it inside the logstash filter as:
...
[fields][mytype] - I can check it inside the 'if' statements, etc ..
How do I assign the value of that file to the new filed created in the mutate section using add_field:
add_field => { "NEWFIELD", [fields][mytype] } - this did not work - what is the correct syntax for this ?
I also tried referencing it with %{[field][mytype]} - but that did not work either:
add_field => { "NEWFIELD", %{[fields][mytype]} }
You might also want to use a mutate filter and its rename option if you want to move a field. With add_field you'll end up with two fields with the same contents.
Another option is to configure Filebeat to store the extra fields at the root of the event rather than as subfields of fields. See Filebeat's fields_under_root 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.