How can i create a DLS query from 3 Separte filter i have added?

i have created 3 separate filters on a dashboard but i want these to be one filter.

I understand this can be done from a DLS Query.

Is there anyway to use kibanaSavedObjectMeta.searchSourceJSON as the DLS?

if so what part of it can be used?

Do you mean DSL? If so you can combine queries using a bool query.

Hi, Yes i meant DSL & Thanks for that, are you able to help me construct this? Below are the 3 separate query's

{
"exists": {
"field": "sent_time"
}
}


{
"query": {
"match": {
"direction.keyword": {
"query": "O",
"type": "phrase"
}
}
}
}


{
"query": {
"match": {
"file_status.keyword": {
"query": "File_Sent",
"type": "phrase"
}
}
}
}

Here's an example. This bool filter will only match documents that match all three sub-queries.

{
  "query": {
    "bool": {
      "filter": [
        {
          "exists": {
            "field": "sent_time"
          }
        },
        {
          "match": {
            "direction.keyword": {
              "query": "O",
              "type": "phrase"
            }
          }
        },
        {
          "match": {
            "file_status.keyword": {
              "query": "File_Sent",
              "type": "phrase"
            }
          }
        }
      ]
    }
  }
}
1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.