Hi, I´m trying to add some info to my logs via xm_perl before send it to elasticsearch (using json format). As result, it would be nice to add some fileds from my perl code in nested way. Is it posible to use something like set_field_XXX($event, "myAddedfield.myAddedSubfield", "value")?


At the end, I want to create nested fields inside my json object.



AskedJuly 4, 2016 - 7:17pm

Answer (1)

NXLog does not have support for nested structures, though the recently released EE v3.0 has an UnFlatten option for xm_json that can generate nested JSON when fields are specified using a dot notation (e.g. "myAddedfield.myAddedSubfield").

Another solution is to convert to JSON from perl and put the JSON string into $raw_event.