ElasticSearch实现GroupBy多字段分组统计
需求描述
对clientip,request,vhost 三个字段进行group by分组统计count,之后根据传入的时间进行区间筛选。
转换成对应的sql应该是
select
MAX(@timestamp) as accessTimeStamp,
clientip as clientIp, request,
vhost, count(*) AS accessCount
from nginxweb-2022-08-17
where @timestamp between '2021-08-17T00:24:41.000Z'
and '2023-08-17T00:25:00.000Z'
GROUP BY