7.1 使用 Kibana 查询日活和小时明细
要查询的数据格式:
日活
[ {"id":"dau","name":"新增日活","value":1200}, {"id":"new_mid","name":"新增用户","value":233} ]
小时明细:
{ "yesterday":{"钟点":数量, "钟点":数量, ...}, "today":{"钟点":数量, "钟点":数量, ...} } 例如: { "yesterday":{"11":383,"12":123,"17":88,"19":200 }, "today":{"12":38,"13":1233,"17":123,"19":688 } }
查询某天日活总数
不需要做聚合, 直接得到命中的总数即可
GET /gmall_dau/_search
{
"query": {
"bool": {
"filter": {
"term": {
"logDate": "2019-05-15"
}
}
}
}
}
查询某天日活小时明细
GET /gmall_dau/_search
{
"query": {
"bool": {
"filter": {
"term": {
"logDate": "2019-05-15"
}
}
}
}
, "aggs": {
"groupby_hour": {
"terms": {
"field": "logHour",
"size": 24
}
}
}
}