Csv output plugin - custom field

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,



You can use mutate or kv plugin in filter to add field.

Thanks & Regard,

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:

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 :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.