简体   繁体   English

无法在Grafana 2.x中从Elasticsearch Lucene查询中绘制图表

[英]Not able to plot diagram from Elasticsearch Lucene query in Grafana 2.x

I am using Grafana with Elasticsearchas data source. 我正在使用带有Elasticsearchas数据源的Grafana。 On each of my documents, I have a field "id" and "lastmodifiedDate". 在每个文档上,我都有一个字段“ id”和“ lastmodifiedDate”。 I would like to show the table with the count of id's accordingly last modified date. 我想显示带有ID相应上次修改日期的计数表。

here is my document: 这是我的文件:

{
        "_index": "global_search",
        "_type": "News_Item",
        "_id": "48",
        "_score": 1,
        "_source": {
          "id": "48",
          "dueDate": 1478802600000,
          "lastModifiedDate": 1478802600000,
          "whenCreatedDate": 1477506600000,
          "ownerEmail": "abc@gmail.com",
          "owner": {
            "firstname": "ABC",
            "lastname": "Kumar",
            "email": "abc@gmail.com"
          },
          "subject": "USA','According to NBCDFW.com, an explosion at a silicon plant ",
          "status": "NEW",
          "updatedby": "ABC Kumar",
          "content": "Text data"
        }
      },
      {
        "_index": "global_search",
        "_type": "News_Item",
        "_id": "26",
        "_score": 1,
        "_source": {
          "id": "26",
          "dueDate": 1477679400000,
          "lastModifiedDate": 1477679400000,
          "whenCreatedDate": 1477506600000,
          "researchTitle": "Flash Floods Hit Parts of Southern France",
          "ownerEmail": "xyz@gmail.com",
          "owner": {
            "firstname": "XYZ",
            "lastname": "Kumar",
            "email": "xyz@gmail.com"
          },
          "subject": "Flash Floods Hit Parts of Southern France",
          "status": "MONITORING",
          "updatedby": "XYZ",
          "content": "Text2 data"
        }
      }

Question: How to plot table with count of id's according date?What is the exact Lucene query to plot the table? 问:如何绘制具有ID的依日期的表格?Lucene查询要绘制表格的确切方式是什么?

You can get it with below query parameters: 您可以使用以下查询参数获取它:

Metric:
  Count
Group by:
  type: Date Histogram
  field: lastModifiedDate

Query field can be left blank. 查询字段可以留为空白。

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

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