简体   繁体   English

Grafana与Elasticsearch的联系

[英]Grafana connection with elasticsearch

I have successfully create a connection between Grafana and Elasticsearch. 我已经成功创建了Grafana和Elasticsearch之间的连接。 I have already indexed data into Elasticsearch , but Grafana doesn't want to show it as a "Singlestat". 我已经将数据索引到Elasticsearch中,但是Grafana不想将其显示为“ Singlestat”。

Elasticsearch Data Picture Elasticsearch数据图片

Grafana Settings Picture Grafana设置图片

So the value is "104". 因此,值为“ 104”。 But why Grafana does not show this? 但是,为什么Grafana没有显示呢?

If you would like to show the current value in SigleStat panel you should do it in the following way: 如果要在SigleStat面板中显示当前值,则应采用以下方式:

  1. In Elastic end - Save it as int, as in SigleStat panel you can show only integers fields. 在Elastic end-将其另存为int,如在SigleStat面板中,您只能显示整数字段。

  2. In Grafana end - a. 在Grafana结束-a。 Add "ecommerce" index as data source (located in top left menu - data sources). 添加“电子商务”索引作为数据源(位于左上方菜单-数据源)。

    b. b。 In SigleStat panel - "Metrics" tab - choose "ecommerce" data source. 在SigleStat面板的“指标”选项卡中,选择“电子商务”数据源。

    c. C。 In the query line: write the following "_type:supporttickets". 在查询行中:编写以下“ _type:supporttickets”。

    d. d。 In Metric field - choose "Max" and "value" (if value is not int you will not see it in dropdown). 在“指标”字段中-选择“最大值”和“值”(如果value不是int,则不会在下拉列表中看到它)。

    e. e。 In SigleStat panel - "Options" tab - in "Stat" dropdown choose "current". 在SigleStat面板的“选项”选项卡中的“统计”下拉列表中,选择“当前”。 More options like colors by thresholds and stuff - http://docs.grafana.org/features/panels/singlestat/ 更多选项,例如按阈值和填充物的颜色-http: //docs.grafana.org/features/panels/singlestat/

Metric -> sum -> is looking for Numeric value but it is getting a string("104"). 指标-> sum->正在寻找数值,但它得到的是字符串(“ 104”)。

  • Insert the values of "@value" column as Integer in Elasticsearch 在Elasticsearch中将“ @value”列的值插入为Integer

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

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