2017-12-19 29 views
0

예외 및/또는 오류를 반환하는 쿼리가 있습니다. 그 결과는 동일한 결과를 반환한다는 것입니다. 이것은 해당 쿼리에서 발췌 한 동작입니다.elasticsearch/kibana에서 중복 된 결과를 피하는 방법

고유 한 결과 만 반환하는 결과를 어떻게 관리 할 수 ​​있습니까? 당신은 유일한 예외/오류를 얻을 수 집계를 추가 (및 계산) 할 필요가

{ 
    "query": { 
    "bool": { 
     "should": [ 
     { "match": { "message": "error" }}, 
     { "match": { "message": "exception" }} 
     ], 
     "must_not": { 
     "match": { 
      "message": "io.vertx.spi.cluster.zookeeper.ZookeeperClusterManager" 
     } 
     } 
    } 
    } 
} 

답변

0

:

이 내 쿼리입니다. 이런 식으로 뭔가를 시도 :

{ 
    "query": { 
    "bool": { 
     "should": [ 
     { "match": { "message": "error" }}, 
     { "match": { "message": "exception" }} 
     ], 
     "must_not": { 
     "match": { 
      "message": "io.vertx.spi.cluster.zookeeper.ZookeeperClusterManager" 
     } 
     } 
    } 
    }, 
    "aggs" : { 
    "errors_exceptions" : { 
     "terms" : { "field" : "message" } 
    } 
    } 
} 

PS를 : 자주 이렇게 할 경우, 선행을 제외하고, 예를 들어 in your logappender (this is just one example, you can probably find something similar for your use case) 또는 Logstash와의 해시를 계산하기 위해 저렴 수 있습니다.