# Kibana multiple query is not allowed

**URL:** <https://discuss.elastic.co/t/kibana-multiple-query-is-not-allowed/227814>\
**Category:** Kibana\
**Created:** [April 13, 2020, 6:25pm UTC](https://discuss.elastic.co/t/kibana-multiple-query-is-not-allowed/227814 "2020-04-13T18:25:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![111316](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111316/32/66237_2.png) [@111316](https://discuss.elastic.co/u/111316)\
**Post date:** [April 13, 2020, 6:25pm UTC](https://discuss.elastic.co/t/kibana-multiple-query-is-not-allowed/227814/1 "2020-04-13T18:25:47Z")

</div>

Hello!

To use multiple queries as below, an error occurs.  
Please tell me how to use 2 IP bands.

{  
"query": {  
"bool": {  
"should": [  
{  
"match\_phrase": {  
"flow.dst\_addr": {"gte": "1.1.1.1", "lt": "1.1.1.254"}}  
},  
{  
"match\_phrase": {  
"flow.dst\_addr": {"gte": "2.2.2.1", "lt": "2.2.2.254"}  
}  
}  
],  
"minimum\_should\_match": 1  
}  
}  
}

※ Error in visualization

[esaggs] \> Request to Elasticsearch failed: {"error":{"root\_cause":[{"type":"parsing\_exception","reason":"[match\_phrase] query does not support [gte]","line":1,"col":1475}],"type":"parsing\_exception","reason":"[match\_phrase] query does not support [gte]","line":1,"col":1475},"status":400}

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [April 14, 2020, 10:33pm UTC](https://discuss.elastic.co/t/kibana-multiple-query-is-not-allowed/227814/2 "2020-04-14T22:33:31Z")

</div>

You can use a KQL expression similar to this:

```auto
(flow.dst_addr >= 1.1.1.1 and flow.dst_addr < 1.1.1.254) or (flow.dst_addr >= 2.2.2.1 and flow.dst_addr < 2.2.2.254)

```

---

<div class="post-metadata">

**Author:** ![Luca\_Belluccini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luca_belluccini/32/33239_2.png) [@Luca\_Belluccini](https://discuss.elastic.co/u/Luca_Belluccini)\
**Post date:** [April 15, 2020, 12:17am UTC](https://discuss.elastic.co/t/kibana-multiple-query-is-not-allowed/227814/3 "2020-04-15T00:17:28Z")

</div>

@lukas is right.

In DSL, you might want to use:

```auto
GET myindex/_search
{
  "query": {
    "bool": {
      "should": [
        {
          "range": {
            "flow.dst_addr": {
              "gte": "1.1.1.1",
              "lt": "1.1.1.254"
            }
          }
        },
        {
          "range": {
            "flow.dst_addr": {
              "gte": "2.2.2.1",
              "lt": "2.2.2.254"
            }
          }
        }
      ],
      "minimum_should_match": 1
    }
  }
}

```

Or:

```auto
GET myindex/_search
{
  "query": {
    "bool": {
      "should": [
        {
          "term": {
            "flow.dst_addr": "1.1.1.1/24"
          }
        },
        {
          "term": {
            "flow.dst_addr": "2.2.2.1/24"
          }
        }
      ],
      "minimum_should_match": 1
    }
  }
}

```

---

<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:** [May 13, 2020, 12:17am UTC](https://discuss.elastic.co/t/kibana-multiple-query-is-not-allowed/227814/4 "2020-05-13T00:17:29Z")

</div>

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