ES 时间范围内过滤
程序员文章站
2024-02-08 18:01:40
...
GET /apps_zego_logs-2018.09.25/_search
{
"size": 1,
"query": {
"bool": {
"must": [
{"range": {
"@timestamp": {
"gte": "now-1h",
"lte": "now",
"format": "yyyy-MM-dd-HH",
"time_zone":"+08:00"
}
}
}
]
}
},
"aggs": {
"diff_user": {
"cardinality" : {
"field": "userid.keyword"
}
},
"over_time" : {
"date_histogram" : {
"field" : "@timestamp",
"interval" : "minute",
"format": "yyyy-MM-dd-HH-mm",
"time_zone":"+08:00",
"min_doc_count" : 0
},
"aggs": {
"diff_user": {
"cardinality" : {
"field": "userid.keyword"
}
}
}
}
},
"collapse": {
"field": "userid.keyword"
}
}
上一篇: PHP怎么取得跳转过来的网址