Logstash: Mutate / Convert not working on nested fields

Created on 16 Oct 2014  路  3Comments  路  Source: elastic/logstash

I am using the JSON filter to parse some JSON data and create fields. This results in fields with names such as details.order.price and details.order.qty. I am trying to convert these fields into float but it is not working. Does anyone know how to do this?

I am trying:

convert => [ "details.order.price", "float" ]
convert => [ "details.order.qty", "float" ]

I also tried the following:

convert => [ "details", "float" ]
convert => [ "price", "float" ]

Thanks

Most helpful comment

For anyone finding this through Google, the updated URL for the relevant reference page is https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references

All 3 comments

@cschotke did you try this (http://logstash.net/docs/1.4.2/configuration#fieldreferences)

convert => [ "[details][order][price]", "float" ]
convert => [ "[details][order][qty]", "float" ]

That worked. Thank you!

For anyone finding this through Google, the updated URL for the relevant reference page is https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references

Was this page helpful?
0 / 5 - 0 ratings