1、找出每天的独立IP访问来源
使用nested aggregation,在一个date histogram aggregation做按照天分组后,再对每天的结果用cardinality aggregation计数
POST /access/search/_search { "size" : 0, "aggs" : { "dailyIP" : { "date_histogram" : {"field":"date", "interval" : "day"}, "aggs" : { "unique_ip" : {"cardinality" : {"field" : "IP"} } } } } }
时间: 2024-11-03 13:50:30