Filter mutate add_field : select a value in an inner field

I have a json input :


I want to add at root the field fields.station_id

The code bellow does not work:
filter { mutate { add_field => { "station_id" => "%{[fields][station_id]}"} } }

Actually it create a field station_id with value literrally without interpretion of value

Please, could you help me to improve my selector?

Your fields field isn't an object with fields like station_id, it's a JSON string that needs to be parsed. Use a json filter for that.

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