我在elasticsearch中有如下文档,
POST test_results/_doc
{
"name": "Adam",
"passed": true,
"timestamp": 1600161457008
}
POST test_results/_doc
{
"name": "Thomas",
"passed": true,
"timestamp": 1600161457008
}
POST test_results/_doc
{
"name": "Harry",
"passed": false,
"timestamp": 1600161457008
}
POST test_results/_doc
{
"name": "Bob",
"passed": true,
"timestamp": 1600161457008
}
我想想象一下在给定时间内通过考试的学生的百分比
1条答案
按热度按时间abithluo1#
您可以使用elasticsearch bucket脚本聚合来实现这一点,grafana中的配置如下所示。一定要隐藏计数指标,只显示百分比指标,