比我我有按日期汇总好的游戏活跃用户总数和付费总额,我想展示ARPU(付费总额/活跃用户总数),这个怎么用kibana画图?
{
"size": 0,
"query": {
"query_string": {"query": "*"}
},
"aggs": {
"2": {
"date_histogram": {
"field": "date",
"interval": "1d",
"time_zone": "Asia/Shanghai",
"min_doc_count": 1
},
"aggs": {
"sum_pay1": {
"sum": {
"field": "pay"
}
},
"sum_active1": {
"sum": {
"field": "active_users"
}
},
"ARPU":{
"bucket_script": {
"buckets_path": {
"sumpay": "sum_pay1",
"sumactive": "sum_active1"
},
"script": "sumpay / (1.0*sumactive)"
}
}
}
}
}
}
如何展示ARPU?
{
"size": 0,
"query": {
"query_string": {"query": "*"}
},
"aggs": {
"2": {
"date_histogram": {
"field": "date",
"interval": "1d",
"time_zone": "Asia/Shanghai",
"min_doc_count": 1
},
"aggs": {
"sum_pay1": {
"sum": {
"field": "pay"
}
},
"sum_active1": {
"sum": {
"field": "active_users"
}
},
"ARPU":{
"bucket_script": {
"buckets_path": {
"sumpay": "sum_pay1",
"sumactive": "sum_active1"
},
"script": "sumpay / (1.0*sumactive)"
}
}
}
}
}
}
如何展示ARPU?
0 个回复