查询格式错误,查询名称后没有start_object

pun*_*eth 13 elasticsearch elastalert

我正在针对AWS Elasticsearch 5.1运行此查询并获取格式错误的查询错误.这是请求的正文.我基本上只是在时间范围内检查字段是否存在.

{
  "query": {
    "bool": {
      "filter": {
        "bool": {
          "must": [
            {
              "range": {
                "@timestamp": {
                  "gt": "2017-03-21T15:37:08.595919Z",
                  "lte": "2017-04-21T15:52:08.595919Z"
                }
              }
            },
            {
              "query": [
                {
                  "query_string": {
                    "query": "_exists_: $event.supplier"
                  }
                }
              ]
            }
          ]
        }
      }
    }
  },
  "sort": [
    {
      "@timestamp": {
        "order": "asc"
      }
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

And*_*fan 12

第二个must陈述不正确:

{
  "query": {
    "bool": {
      "filter": {
        "bool": {
          "must": [
            {
              "range": {
                "@timestamp": {
                  "gt": "2017-03-21T15:37:08.595919Z",
                  "lte": "2017-04-21T15:52:08.595919Z"
                }
              }
            },
            {
              "query_string": {
                "query": "_exists_: $event.supplier"
              }
            }
          ]
        }
      }
    }
  },
  "sort": [
    {
      "@timestamp": {
        "order": "asc"
      }
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

  • 第二个必须声明的地球在哪里? (26认同)
  • 给出答案后,他们删除了曾经位于query_string附近的query指定符。 (2认同)
  • 对于将来到这里的人:“必须”是一个数组,因此容纳“ query_string”的第二组花括号是第二个“必须”。 (2认同)