elasticsearchkibanatimelion

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


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.


Solution

  • 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).