Want to get distinct record across 2 fields

I have an index where data may be duplicating . but in those duplicating data set. i have 2 fields that does not change . Now I want to get count of distinct records

Ex:-
cid='AE123456XYZ',
opname ='getData'
isError=1
error='blah'

in the above cid, opname ,isError will repeat across the duplicate data set. I want to find distinct counts based on those 2 (cid & opname) combination. Is that possible ?

You could use something like a terms aggregation and then a sub aggregation on cardinality.
e.g.

Also, you could pre-index those fields into one and just do a terms aggregation on that new field.

I hope this helps.

Thanks . let me try this out .

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