2014-09-18 61 views
0

我不知道我怎樣才能做到這一點,但我已經導入了以下數據elasticsearch:從整型字段創建圖表

{ 
    "_index": "logstash-2014.09.18", 
    "_type": "profiler", 
    "_id": "Wp6zn3CSQ9qhdt8cfHxEgw", 
    "_score": null, 
    "_source": { 
    "message": ["wm.server.query:getClusterError,2"], 
    "@version": "1", 
    "@timestamp": "2014-09-18T15:49:26.287Z", 
    "type": "svc-profiler", 
    "host": "pc.local", 
    "path": "/Users/myuser/profiler.csv", 
    "Service Name": "wm.server.query:getClusterError", 
    "Call Count": "2" 
    }, 
    "sort": [ 
    1411055366287, 
    1411055366287 
    ] 
} 

而且我不知道我怎麼能創建圖表(酒吧或派)使用電話號碼字段。

對不起,如果我不清楚,但英語不是我的母語...

因此,任何人有我如何能實現創建使用該領域中的圖表任何提示?

在此先感謝。

回答

1

你的榜樣記錄顯示,它在你的ES集羣作爲一個字符串。你需要加載它作爲一個數字,以便能夠製作圖表。你需要使用這樣的事情在你的logstash配置把現場變成一個數字:

filter { 
    mutate { 
    convert => { "Call Count" => "integer" } 
    } 
} 

既然你不能改變現有的映射,你需要重新加載您的數據能夠做有用的事情。

一旦你這樣做了,你可以使用一個直方圖面板Call Count作爲領域,並做它的總數或平均值。

+0

我發現在發佈這裏幾小時後=)做convert + terms_stats解決了我的問題! – 2014-09-19 08:57:08