从整数字段创建图表

时间:2014-09-18 16:15:27

标签: elasticsearch logstash kibana

我不确定如何实现这一目标,但我将以下数据导入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 个答案:

答案 0 :(得分:1)

您的示例记录显示它在您的ES群集中​​是一个字符串。您需要将其加载为数字才能生成图表。您需要在logstash配置中使用类似的内容将字段转换为数字:

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

由于您无法更改现有映射,因此您需要重新加载数据才能执行任何有用的操作。

一旦你这样做,你可以使用一个以Call Count作为字段的直方图面板,并对其进行总计或平均。

相关问题