Kibana: Using Terms Query by index in dashboards

Viewed 19

I am currently using Terms Query by index to filter a query:

{
          "query": {
            "bool": {
              "must": [
                {
                  "terms": {
                    "test.type.name": {
                      "index": "test-type-index",
                      "id": "unit-test",
                      "path": "type.name"
                    }
                  }
                },
                {
                  "term": {
                    "test.env": {
                      "value": "dev"
                    }
                  }
                }
              ]
            }
          }
    }

Example of test-type-index:

{
        "_index": "test-type-index",
        "_id": "unit-test",
        "_score": 1.0,
        "_source": {
          "type": [
            {
              "name": "test1",
            },
            {
              "name": "test2",
            }
          ]
        }
      }
}

I am trying to create a dashboard based on this query. How can I create these visualisations?

  • Create visualisation based on the above query. I managed to use DSL to filter the results in discover using this query but not the visualisation.
  • Create an option list of test-type-index ids then use the type names to filter another visualisation.
1 Answers

It's not yet possible to create a dashboard control based on the terms lookup query, but there's ongoing work on this and that might be added in the future.

Right now, you can add that query directly into the DSL tab of a new custom filter, but that's pretty much it.

Related