I'm following Csv output plugin | Logstash Reference [6.1] | Elastic and I have a question...
How would I add extra field with my own text?
Please advise.
I'm following Csv output plugin | Logstash Reference [6.1] | Elastic and I have a question...
How would I add extra field with my own text?
Please advise.
hi @alexus,
https://www.elastic.co/guide/en/logstash/current/plugins-filters-kv.html
You can use mutate or kv plugin in filter to add field.
Thanks & Regard,
Krunal.
I've tried adding following:
filter {
mutate {
add_field => { "key" => "value" }
}
}
yet file came out without new column "key" with "value" in every row...
i have been try this to add extra field and its working fine:
filter
{
mutate
{
add_field => ["Local_ip", "%{[Local][2]}"]
}
}
hmm, your example looks similar to mine, except for in mine (per Logstash's reference example), I used curly brackets and you use square brackets...
Did you had to adjust output somehow to reflect new field in output file somehow? maybe that's the part I'm missing somehow?
ahh, I was right... I added in output csv fields added my new field and now it's working as expected)
Great
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 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.