我想知道ip地址在最后5分钟内的请求数量。我得到了这个查询的请求
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"range": {
"@timestamp": {
"from": "now-5m",
"to": "now"
}
}
}
}
}
}现在我想用相同的clientip字段添加请求,我知道我需要使用聚合,但我不知道如何确切地构造查询。
发布于 2014-07-31 13:53:09
确保字段“ipaddress”没有标记:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"range": {
"@timestamp": {
"from": "now-5m",
"to": "now"
}
}
}
}
},
"aggs": {
"ipaddress": {
"terms": {
"field": "ipaddress"
}
}
}
}https://stackoverflow.com/questions/25060378
复制相似问题