elasticsearch - 在Jaeger ElasticSearch中搜索

标签 elasticsearch search jaeger

我从Jaeger ElasticSearc查询返回以下条目

    "_index" : "jaeger-span-2020-07-31",
    "_type" : "span",
    "_source" : {
      "startTime" : 1596157225275112,
      "startTimeMillis" : 1596157225275,
      "duration" : 0,
      "tags" : [
        {
          "key" : "span.kind",
          "type" : "string",
          "value" : "server"
        },
        {
          "key" : "internal.span.format",
          "type" : "string",
          "value" : "zipkin"
        }
      ],
      "process" : {
        "serviceName" : "transaction-manager",
      }
    }
  }
我的目标是找到具有标签[“internal.span”]“zipkin”的条目。字段“标签”为“嵌套”。我正在尝试以下查询。我没有命中。我想念什么?
{
  "from": 0,
  "size": 1,
  "query": { 
          "bool": {
              "must": [ 
                  {"match": { "process.serviceName": "transaction-manager" }},
                  {
                          "nested": {
                              "path": "tags",
                              "query": {
                                  "match": {
                                      "value": "zipkin"
                                  }
                              }
                          }
                  }
              ]
          }
      }
}

最佳答案

您只需要在匹配查询中使用tags.value而不是value
下面的查询应该有所帮助:

POST <your_index_name>/_search
{
  "from": 0,
  "size": 1,
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "process.serviceName": "transaction-manager"
          }
        },
        {
          "nested": {
            "path": "tags",
            "query": {
              "match": {
                "tags.value": "zipkin"        <---- Note this
              }
            }
          }
        }
      ]
    }
  }
}

关于elasticsearch - 在Jaeger ElasticSearch中搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63198673/

相关文章:

php - array_search 没有找到所有的值

java - 将跟踪从Docker容器发送到在VM中运行的Jaeger Docker容器的问题

elasticsearch - 在没有仪表板的情况下控制多个Kibana可视化?

python - 奥杜 10 : Changing the default search in tree view

java - 如何以正确的方式过滤 ArrayList 的内容?

go - Go GRPC opentracing中的子范围

javascript - 如何通过前端应用程序中的 OpenTelemetry 将跟踪数据发送到 Jaeger?

elasticsearch - Elasticsearch:按日期和时间过滤为不同的字段

elasticsearch - 短语搜索的词干提取和突出显示

elasticsearch - ElasticSearch 中自定义 Kibana 仪表板的位置