xm_perl with nested fields

Tags:

#1 zz

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.

 

Thx.

#2 adm Nxlog ✓
#1 zz
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.   Thx.

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.