How to add a new field and value with field name and value taken from another fields value?

I would like to know how I could do this kind of new field:

  • Field "sesssion.variable_name" exists and has a value for example "session.username"
  • Field "session.variable_value" exists and has a value for example "Mike"

How could I add a new field and name it by taking the value of the field "sesssion.variable_name" and then adding a value to that new field from the field "session.variable_value"?

So the ending should be a field-value pair "session.username=Mike".

Thanks.

filter { mutate { add_field => { "%{session.variable_name}" => "%{session.variable_value}" } } }

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