Kibana Timelion plugin how to specify a field in the elastic search

 ̄綄美尐妖づ 提交于 2019-12-20 01:07:26

问题


I'm trying to use Timelion plugin for kibana.

I have a dataset in the elasticsearch, the structure may be like this:

{
    "_index": "metrics-2016-03",
    "_type": "gauge",
    "_id": "AVM2O7gbLYPaOnNTBgG0",
    "_score": 1,
    "_source": {
        "name": "kafka.network.RequestChannel.ResponseQueueSize",
        "@timestamp": "2016-03-02T07:29:56.000+0000",
        "value": 4,
        "host": "localhost"
    }
}

I want to show the "value" field as the y axis and "@timestamp" as the x aixs, how should I do?

I tried the .es() function, but this function seems to set the count as the default value, not the "value" field in the datasource.


回答1:


Timelion uses pre-defined time intervals for its time plots. In order to plot the "value" as function of time you can set the granularity to 'Auto' and use this string:

 .es(metric='max:value')

You can also set the granularity to the minimum possible and add .fit(carry) to the above string in order to fill null values, in that case you can replace max with min or avg, it will produce the same plot (sum won't work here).




回答2:


.es(metric='sum:value')

Try above, it should work fine, make sure you configured timeline.json



来源:https://stackoverflow.com/questions/35762103/kibana-timelion-plugin-how-to-specify-a-field-in-the-elastic-search

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!