简体   繁体   English

Kibana Timelion插件如何在弹性搜索中指定一个字段

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

I'm trying to use Timelion plugin for kibana. 我正在尝试使用Timelion插件来制作kibana。

I have a dataset in the elasticsearch, the structure may be like this: 我在elasticsearch中有一个数据集,结构可能是这样的:

{
    "_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? 我想将"value"字段显示为y轴,将"@timestamp"为x "@timestamp" ,我该怎么办?

I tried the .es() function, but this function seems to set the count as the default value, not the "value" field in the datasource. 我尝试了.es()函数,但是这个函数似乎将count设置为默认值,而不是数据源中的“value”字段。

Timelion uses pre-defined time intervals for its time plots. Timelion使用预定义的时间间隔作为其时间图。 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). 您还可以将粒度设置为尽可能小的值并将.fit(carry)添加到上面的字符串以填充空值,在这种情况下,您可以使用minavg替换max ,它将生成相同的绘图( sum won'在这里工作)。

.es(metric='sum:value')

尝试上面,它应该工作正常,请确保您配置timeline.json

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM