我有一个index
,其中包含学生的出勤数据。
{
"date" : "24/07/2018",
"Total students" : 30,
"present" : 10,
"absent" : 20
},
{
"date" : "24/08/2018",
"Total students" : 40,
"present" : 20,
"absent" : 20
}
我想在Kibana visualize
中为以下各项创建仪表板:
elastic search
查询可能如下:
POST students_data/_search
{
"size": 0,
"aggs" : {
"agg_per_month" : {
"date_histogram" : {
"field" : "date",
"calendar_interval" : "month"
},
"aggs": {
"total_students": {
"sum": {
"field": "Total students"
}
},
"tot_absentees": {
"sum": {
"field": "absent"
}
},
"absentees-percentage": {
"bucket_script": {
"buckets_path": {
"param_tot_absentees": "tot_absentees",
"param_tot_students": "total_students"
},
"script": "params.param_tot_absentees / params.param_tot_students * 100"
}
}
}
}
}
}
我不知道如何在Kibana可视化工具中完成此操作