編輯:請參閱以下解決方案Grafana 4模板與Elasticsearch 5
目前其在Grafana模板的問題 - 試圖從一些數據,我喂在通過Logstash的石墨Elasticsearch主機名的下拉列表插件,所以我可以在Grafana中構建一個動態模板。
版本 Grafana 4.1.2 + Elasticsearch/Logstash 5.2.1
在Grafana條款查詢我試圖用的是按照文檔grafana網站上進行如下 - http://docs.grafana.org/features/datasources/elasticsearch/:
{"find": "terms", "field": "host_name"}
這工作得很好,如果該字段是一個數字類型的字段 - 例如,我得到的metric_value模板的結果,但這似乎不適用於文本/字符串字段。我想知道這是否可能是由於我構建或攝取字段的方式 - 您可以在下面看到我如何嘗試實現這一點 - 請注意,我已經嘗試了「關鍵字」和「文本」類型領域,既不似乎工作
這是我使用的Logstash輸入濾波器 - 基本上是試圖分裂石墨風格量度輸入到單獨的領域 -
和實例文檔,我的索引(取自kibana)
{
"_index": "graphite-2017.02",
"_type": "graphite",
"_id": "XYZdflksdf",
"_score": null,
"_source": {
"@timestamp": "2017-02-21T00:17:16.000Z",
"metric_name": "interface-eth0.snmp-interface.perfdata.eth0_in_discard",
"port": 37694,
"icinga2.XXXYYY.services.interface-eth0.snmp-interface.perfdata.eth0_in_discard.value": 357237,
"@version": "1",
"host": "192.168.1.1",
"metric_type": "services",
"metric_value": 357237,
"message": "icinga2.XXXYYY.services.interface-eth0.snmp-interface.perfdata.eth0_in_discard.value 357237 1487636236",
"type": "graphite",
"host_name": "XXXYYY",
"timestamp": "1487636236"
},
"fields": {
"@timestamp": [
1487636236000
]
},
"sort": [
1487636236000
]
}
https://github.com/grafana/grafana/issues/7335 – trogs
http://www.pipebug.com/elasticsearch-logstash-kibana-4-mapping-4.html – trogs
https:// www。 elastic.co/guide/en/beats/filebeat/1.2/filebeat-template.html – trogs