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

**URL:** <https://discuss.elastic.co/t/how-can-i-create-a-dls-query-from-3-separte-filter-i-have-added/173769>\
**Category:** Kibana\
**Created:** [March 25, 2019, 2:18pm UTC](https://discuss.elastic.co/t/how-can-i-create-a-dls-query-from-3-separte-filter-i-have-added/173769 "2019-03-25T14:18:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ek9boy](https://avatars.discourse-cdn.com/v4/letter/e/50afbb/32.png) [@ek9boy](https://discuss.elastic.co/u/ek9boy)\
**Post date:** [March 25, 2019, 2:18pm UTC](https://discuss.elastic.co/t/how-can-i-create-a-dls-query-from-3-separte-filter-i-have-added/173769/1 "2019-03-25T14:18:33Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [March 26, 2019, 7:12pm UTC](https://discuss.elastic.co/t/how-can-i-create-a-dls-query-from-3-separte-filter-i-have-added/173769/2 "2019-03-26T19:12:15Z")

</div>

Do you mean DSL? If so you can combine queries using a [bool query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html).

---

<div class="post-metadata">

**Author:** ![ek9boy](https://avatars.discourse-cdn.com/v4/letter/e/50afbb/32.png) [@ek9boy](https://discuss.elastic.co/u/ek9boy)\
**Post date:** [March 27, 2019, 8:25am UTC](https://discuss.elastic.co/t/how-can-i-create-a-dls-query-from-3-separte-filter-i-have-added/173769/3 "2019-03-27T08:25:33Z")

</div>

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"  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [March 27, 2019, 2:59pm UTC](https://discuss.elastic.co/t/how-can-i-create-a-dls-query-from-3-separte-filter-i-have-added/173769/4 "2019-03-27T14:59:21Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 24, 2019, 2:59pm UTC](https://discuss.elastic.co/t/how-can-i-create-a-dls-query-from-3-separte-filter-i-have-added/173769/5 "2019-04-24T14:59:26Z")

</div>

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