I am trying to get top 5 IP between certain time range with the below query. But it is not working.
Please tell me what is the problem with query and how to fix it?
{
"size":0,
"query": {
"bool": {
"must_not": [
{"match": { "client_ip": "10.107.**.**" }}
]
},
"range" : {
"timestamp" : {
"gte": "2017-03-25 00:00:00",
"lte": "now"
}
}
},
"aggs":{
"top-terms-aggregation":{
"terms":{
"field":"client_ip.keyword",
"size":5
}
}
}
}
I am getting this error,
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[bool] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
"line": 10,
"col": 5
}
],
"type": "parsing_exception",
"reason": "[bool] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
"line": 10,
"col": 5
},
"status": 400
}
Thank you.