From the following logs I want to check on condition HasErrorState = true and drop the entire event.
Data field will be single entry and in that we have multiple entries for Scales.
Im not sure but if I put that correctly , But in scales it is a collection of arrays , like 0 , 1 ,2 ... entries.
So if the first entry has HasErrorState=true than I have to drop that document/entry to be stored in elastic.
Tried the above solution but seeing a rubyexception.
Are you saying you want to delete any entries from [Data][0][Scales] which have HasErrorState true but retain the event? What to do if [Data][0][Scales] ends up as an empty array?
Yes @Badger ,you are right on deleting and retain part:
Are you saying you want to delete any entries from [Data][0][Scales] which have HasErrorState true but retain the event - YES
If the array is empty we just have to ignore the if condition part as we can't do much in that part.
Please check the JSON that you showed. [Data][0][Scales] is an array that contains a single hash, when the array ends another hash starts. That's not valid JSON.
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.