How to add the value count of 2 search results in Logstash

Hi All,

I have written a scripted filed to add the count of these 2 values Identity Accepted and Identity Rejected.

These values are searched under result keyword

this is my scripted field

if (doc['result'].value == "Identity Accepted") && if (doc['result'].value == "Identity Rejected")
{
    "aggs" : {
        "total no of record processed" : "sum" : { "field" : "result" } }
}

but in kibana the field is showing this error

image

Please help me to fix this issue

this is how my dashboard looks and i can't use the sum function given in Kibana as it will add the count value of all 3 results.

here as you can see total value is coming as 26 after adding all the 3 values

but i need to add the values of these 2

Identity Accepted and Identity Rejected

so the sum should come as 18.

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