Here's an example of a document in my ES index:
{
"src_ip": "192.168.1.1",
"dst_ip": "192.168.1.2"
}
I want obtain the number of occurrences of ip in different documents(in field src_ip or dst_ip). What I would like to get as a result of the query is an aggregation like this:
[
{"ip": "192.168.1.1", "count": 1"},
{"ip": "192.168.1.2", "count": 1"}
]
Any idea about that? Thanks in advance for your help.