A field referenced by another field

Hello,

I would like to copy the value of a 1st field, into a 2nd field which is referenced by a 3rd field.

Example:

field1 = "OK"
field2 = ""
field3 = "field2"

How to copy the value of field1 to field2 using field3 ?

(I'm trying to use %{field3} but it doesn't work :frowning: )

Thanks for your help
Florent

You can do that with Ruby (Logstash Ruby filter). I didn't test it, so I hope I didn't make a mistake. But something like this should work:
event.set(event.get('field3'), event.get('field1'))

Thank you very much, your ruby command is working.
Too bad we can't do it natively with logstash, it is however not an "exotic" need I think ...

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