es聚合查询语法
{
"size": 0,
"query": {
"bool": {
"filter": [
{
"range": {
"@timestamp": {
"gte": 1596572166943,
"lte": 1596593766943,
"format": "epoch_millis"
}
}
},
{
"query_string": {
"analyze_wildcard": true,
"query": "hostname:localhost OR test"
}
}
]
}
},
"aggs": {
"2": {
"date_histogram": {
"interval": "30s",
"field": "@timestamp",
"min_doc_count": 0,
"extended_bounds": {
"min": 1596572166943,
"max": 1596593766943
},
"format": "epoch_millis"
},
"aggs": {
"1": {
"avg": {
"field": "mainunit.flow_count"
}
}
}
}
}
}
size表示查询结果中显示多少条原始语句