I need to find matches for one of the values ​​and then output them into separate groups as in aggregation, that is, for example, I have two ip and mac values, I want to find if there are any matches for these values ​​and if there is one for which of them

    1 answer 1

    Maybe not quite right, but so far I decided to do so. Sense example

    POST _search {"size": 0, "query": { "bool": { "should": [ { "match": { "serial": "AAAAA"}}, { "match": { "ip": "111.111.111.111"}}, { "match": { "mac": "10:01:11:11:11:12"}} ] } },"aggs":{ "serial" : { "filter":{ "term": { "serial": "AAAAA"} } }, "ip" : { "filter":{ "term": { "ip": "111.111.111.111"} } } , "mac" : { "filter":{ "term": { "mac": "10:01:11:11:11:12"} } } } }