# REST API query question

**URL:** <https://discuss.elastic.co/t/rest-api-query-question/141333>\
**Category:** Elasticsearch\
**Created:** [July 24, 2018, 9:13am UTC](https://discuss.elastic.co/t/rest-api-query-question/141333 "2018-07-24T09:13:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![f26227279](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/f26227279/32/21296_2.png) [@f26227279](https://discuss.elastic.co/u/f26227279)\
**Post date:** [July 24, 2018, 9:13am UTC](https://discuss.elastic.co/t/rest-api-query-question/141333/1 "2018-07-24T09:13:38Z")

</div>

Hi, I want to filter out the Sum\_PKTS which value is lower than 10.  
How could I merge the two query string?  
Is it possible?

```
{
   "range":{
        "Sum_PKTS":{
                "gte": 10
              }
       }
}

```

--

```
GET /_search
{
  "size" : 0,
  "query": {
    "bool": {
      "should": [
        {
            "match":{"IPV4_DST_ADDR":"192.168.0.0/16"}
        },
        {
            "match":{"IPV4_SRC_ADDR":"192.168.0.0/16"}
        }
      ],
      "minimum_should_match": 1,
      "must":[
        {
          "range":{
            "@timestamp":{
            "gte":"now-5m"
            }
          }
        }
      ]
    }
  },
    "aggs": {
      "DST_Local_IP": {
        "filter": {
          "bool": {
            "filter": {
                "match":{"IPV4_DST_ADDR":"192.168.0.0/16"}
              }
            }
          },
          "aggs": {
                "genres":{
                    "terms" : {
					"field" : "IPV4_DST_ADDR" ,
					"order" : { "Sum_PKTS" : "desc" }
                    },
                    "aggs":{
			         "Sum_PKTS": {
					 "sum" : { "field" : "Packet" }
                    }
              }
            }
          }
      }, 
      "SRC_Local_IP": {
      "filter": {
        "bool": { 
          "filter": {
              "match":{"IPV4_SRC_ADDR":"192.168.0.0/16"}
            }
          }
        },
		"aggs": {
            "genres":{
                "terms" : {
                    "field" : "IPV4_SRC_ADDR" ,
                    "order" : { "Sum_PKTS" : "desc" }
                    },
                    "aggs":{
				    "Sum_PKTS": {
					"sum" : { "field" : "Packet" }
                }
              }
            }
          }
      }
  }
}

```

thank you in advance!

---

<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:** [August 21, 2018, 9:13am UTC](https://discuss.elastic.co/t/rest-api-query-question/141333/2 "2018-08-21T09:13:46Z")

</div>

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