0
我試圖在grafana中顯示elasticsearch scripted aggregation。 我不能在grafana UI哪裏找出設置我的聚集腳本如何使用Elasticsearch與Grafana的腳本度量聚合
Elasticsearch聚集
{
"scripted_metric": {
"init_script": "_agg['transactions'] = []",
"map_script": "if (doc['type'].value == \"sale\") { _agg.transactions.add(doc['amount'].value) } else { _agg.transactions.add(-1 * doc['amount'].value) }",
"combine_script": "profit = 0; for (t in _agg.transactions) { profit += t }; return profit",
"reduce_script": "profit = 0; for (a in _aggs) { profit += a }; return profit"
}
}
Grafana UI
據我所知沒有實施。 –