elasticsearch Kibana Timelion:子选择或子查询以聚合最大值之和
假设我有以下关于ElasticSearch的数据:
elasticsearch Kibana Timelion:子选择或子查询以聚合最大值之和,
elasticsearch,kibana,timelion,
elasticsearch,Kibana,Timelion,假设我有以下关于ElasticSearch的数据: @timestamp; userId; currentPoints August 7th 2017, 00:30:37.319; myUserName; 4 August 7th 2017, 00:43:22.121; myUserName; 10 August 7th 2017, 00:54:29.177; myUserName; 7 August 7th 2017, 01:10:29.352; myUserName; 4 August 7t
@timestamp; userId; currentPoints
August 7th 2017, 00:30:37.319; myUserName; 4
August 7th 2017, 00:43:22.121; myUserName; 10
August 7th 2017, 00:54:29.177; myUserName; 7
August 7th 2017, 01:10:29.352; myUserName; 4
August 7th 2017, 00:32:37.319; myOtherUserName; 12
August 7th 2017, 00:44:22.121; myOtherUserName; 17
August 7th 2017, 00:56:29.177; myOtherUserName; 8
August 7th 2017, 01:18:29.352; myOtherUserName; 11
我希望绘制一个日期柱状图,该柱状图将显示每个用户名每小时的所有max:currentPoints之和,这将生成以下数据进行绘制:
August 7th 2017, 00; SumOfMaxCurrentPoints -> 27 (max from hour 00h from both users 10 + 17)
August 7th 2017, 00; SumOfMaxCurrentPoints -> 15 (max from hour 01h from both users 4 + 11)
这通常是通过一个子查询完成的,提取用户每小时的最大值(currentPoints),然后对结果求和并聚合每小时
比如说Kibana Timelon,这可能吗?我找不到使用文档实现这一点的方法
谢谢
Alex在另一个项目中工作时,我在Kibana/Elasticsearch中找到了不使用Timelon的答案 该特性称为同级管道聚合,在本例中,您使用Sum Bucket。您可以将其用于任何最近的Kibana/Elastic可视化(我使用的是5.5版) 对于数据集,例如:
@timestamp; userId; currentPoints
August 7th 2017, 00:30:37.319; myUserName; 4
August 7th 2017, 00:43:22.121; myUserName; 10
August 7th 2017, 00:54:29.177; myUserName; 7
August 7th 2017, 01:10:29.352; myUserName; 4
August 7th 2017, 00:32:37.319; myOtherUserName; 12
August 7th 2017, 00:44:22.121; myOtherUserName; 17
August 7th 2017, 00:56:29.177; myOtherUserName; 8
August 7th 2017, 01:18:29.352; myOtherUserName; 11
其中,您希望每个用户标识的(当前点)所有最大值(当前点)的小时总和,结果是:
August 7th 2017, 00; SumOfMaxCurrentPoints -> 27 (max from hour 00h from both users 10 + 17)
August 7th 2017, 00; SumOfMaxCurrentPoints -> 15 (max from hour 01h from both users 4 + 11)
你可以做:
度量标准
嗨,你能解决这个问题吗?我想不起来用Timelong能解决这个问题。最终在项目中使用了其他技术。@Kostanos,您可以在下面找到答案。终于找到了。