2016-12-14 7 views
0

Grafana를 Elasticsearchas 데이터 소스와 함께 사용하고 있습니다. 내 문서에는 "id"와 "lastmodifiedDate"필드가 있습니다. ID의 개수가 마지막으로 수정 된 날짜와 함께 테이블을 표시하고 싶습니다. 여기 Grafana 2.x에서 Elasticsearch Lucene 쿼리의 다이어그램을 그릴 수 없습니다.

내 문서입니다 :

{ 
     "_index": "global_search", 
     "_type": "News_Item", 
     "_id": "48", 
     "_score": 1, 
     "_source": { 
      "id": "48", 
      "dueDate": 1478802600000, 
      "lastModifiedDate": 1478802600000, 
      "whenCreatedDate": 1477506600000, 
      "ownerEmail": "[email protected]", 
      "owner": { 
      "firstname": "ABC", 
      "lastname": "Kumar", 
      "email": "[email protected]" 
      }, 
      "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": "[email protected]", 
      "owner": { 
      "firstname": "XYZ", 
      "lastname": "Kumar", 
      "email": "[email protected]" 
      }, 
      "subject": "Flash Floods Hit Parts of Southern France", 
      "status": "MONITORING", 
      "updatedby": "XYZ", 
      "content": "Text2 data" 
     } 
     } 

질문 : 어떻게 테이블을 그릴 수있는 정확한 루씬 쿼리는 무엇입니까 ID를 따라 날짜의 카운트 테이블을 음모?

답변

0

당신은 쿼리 매개 변수 아래에 그것을 얻을 수 있습니다

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

쿼리 필드를 비워 둘 수 있습니다.