I have a need for doing a timelion count of a certain field (myField)... but only if another field (errorField) is not 0.
So I made a scripted field: myFieldIfNoError
if (doc['errorField'].value != null && doc['errorField'].value != 0){ return doc['myField'].value; } return null.
.es(index=myindex,timefield=myTimeStamp,metric=count:myFieldIfNoError)
But the count is still counting the 0 and null values. I only want a count of myField when errorField is not 0.
What's the right thing to do?