我是Grafana和ElasticSearch的初学者。我在grafana中添加了Elasticsearch源代码。现在,我想做一个查询来显示我的数据。
Elasticsearch中的一个数据示例:
{
"_index": "shinken-2016.04.08",
"_type": "shinken-logs",
"_id": "AVP0GFeTmLuZ9eaw1Bjp",
"_score": 1.0,
"_source":
{
"comment": "",
"plugin_output": "",
"attempt": 0,
"message": "[1460089115] SERVICE NOTIFICATION: shinken;hostname_test.com;MySQL - TCP;CRITICAL;notify-service-by-email;connect to address 10.11.12.13 and port 1234: No route to host",
"logclass": 3,
"options": "",
"state_type": "CRITICAL",
"state": 2,
"host_name": "hostname_test.com",
"@timestamp": "2016-04-08T04:18:35Z",
"time": 1460089115,
"service_description": "MySQL - TCP",
"logobject": 2,
"type": "SERVICE NOTIFICATION",
"contact_name": "shinken",
"command_name": "notify-service-by-email"
}
},
我的目标是在granafa中显示每天的一个服务的状态编号(这里是MySQL - TCP)(这里是2016-04-08)。
我的问题是:如何使用Elasticsearch作为源数据在Grafana中进行查询?