Hi,
how could I detect when an array in a json is empty with logstash ?
example:
EMPTY
"serviceContexts": [ ]
FULL:
"serviceContexts": [{ "service": "JIRA", "monitor": true, "client": null, "org": null, "app": null, "method": "KeyGet", "status": "failure", "duration": 1 } ]
if [serviceContexts] and [serviceContexts][0] { # array has at least one element } else { # array has no elements }
Yes this is what I come up with. Wasn't sure if that was the best way to do it.
Thanks
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.