Empty array getting dropped from output, how do I keep it?

The input to my logstash is is populating [Current][Alarms] from the input ...\"Alarms\":null... when there are no alarms, and when there are alarms then it is a list.
When there are no alarms, I still want to see "Alarms": [] in the output.

When I try to force the empty array from a Ruby block like this event.set('[Current][Alarms]', []) then it does not appear as a field in the output.
Is there a way to force the empty array or will those always get dropped?

ruby { code => 'event.set("[Current][Alarms]", [])' }

results in

   "Current" => {
    "Alarms" => []
}

for me.

This thread can be closed. The issue was that I am using an old version of (based god) Magnus Baeck's logstash-filter-verifier. All good.

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