# Remove default filter from aggregation

**URL:** <https://discuss.elastic.co/t/remove-default-filter-from-aggregation/47108>\
**Category:** Kibana\
**Created:** [April 12, 2016, 10:55am UTC](https://discuss.elastic.co/t/remove-default-filter-from-aggregation/47108 "2016-04-12T10:55:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manish27](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Manish27](https://discuss.elastic.co/u/Manish27)\
**Post date:** [April 12, 2016, 10:55am UTC](https://discuss.elastic.co/t/remove-default-filter-from-aggregation/47108/1 "2016-04-12T10:55:16Z")

</div>

I am trying to create a vertical bar chart with filter aggregation. I am adding JSON input instead of adding separate filters. But we need to have at least one filter there (Filter 1) even if we are providing JSON input. Issue is that in the bar chart, I get an extra bucket with "\*" label which I have not added in my JSON input. I assume it comes from that default filter.  
Is there any setting that I can set to disable this default filter from all visualizations?

---

<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 12, 2016, 5:16pm UTC](https://discuss.elastic.co/t/remove-default-filter-from-aggregation/47108/2 "2016-04-12T17:16:49Z")

</div>

I don't believe there is a way to disable this, but you are correct that it comes from the default filter.

Can you share what your JSON input is? I am not sure there is a workaround, but we can take a closer look.

---

<div class="post-metadata">

**Author:** ![Manish27](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Manish27](https://discuss.elastic.co/u/Manish27)\
**Post date:** [April 13, 2016, 7:07am UTC](https://discuss.elastic.co/t/remove-default-filter-from-aggregation/47108/3 "2016-04-13T07:07:47Z")

</div>

Hi Lukas,

This is the JSON input:

{  
"filters": {  
"CreateOrder": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: CreateOrder"  
}  
}  
},  
"SendOrderEmail": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: SendOrderEmail"  
}  
}  
},  
"RepriceOrder": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: RepriceOrder"  
}  
}  
},  
"SubmitOrder": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: SubmitOrder"  
}  
}  
},  
"CustomerQuery": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: CustomerQuery"  
}  
}  
},  
"UserDetails": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: UserDetails"  
}  
}  
},  
"LDAP": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: LDAP"  
}  
}  
},  
"DeliveryDateQuery": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: DeliveryDateQuery"  
}  
}  
},  
"PickingParameterExport": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: PickingParameterExport"  
}  
}  
},  
"CreditCheck": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: CreditCheck"  
}  
}  
},  
"SubstituteArticles": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: SubstituteArticles"  
}  
}  
},  
"AddCatalogItem": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: AddCatalogItem"  
}  
}  
},  
"CatalogHeaderQuery": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: CatalogHeaderQuery"  
}  
}  
},  
"CatalogItemQuery": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: CatalogItemQuery"  
}  
}  
},  
"CreateCatalog": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: CreateCatalog"  
}  
}  
},  
"DeleteCatalog": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: DeleteCatalog"  
}  
}  
},  
"DeleteCatalogItems": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: DeleteCatalogItems"  
}  
}  
},  
"OrderHeaderQuery": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: OrderHeaderQuery"  
}  
}  
},  
"OrderItemQuery": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: OrderItemQuery"  
}  
}  
},  
"UpdateCatalog": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: UpdateCatalog"  
}  
}  
},  
"UpdateCatalogItems": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: UpdateCatalogItems"  
}  
}  
},  
"PriceMaster": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: PriceMaster"  
}  
}  
},  
"PricingRequest": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: PricingRequest"  
}  
}  
},  
"StockCheck": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: StockCheck"  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![Manish27](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Manish27](https://discuss.elastic.co/u/Manish27)\
**Post date:** [April 13, 2016, 7:09am UTC](https://discuss.elastic.co/t/remove-default-filter-from-aggregation/47108/4 "2016-04-13T07:09:51Z")

</div>

And below is the elasticsearch request body:

{  
"size": 0,  
"aggs": {  
"2": {  
"filters": {  
"filters": {  
"_": {  
"query": {  
"query\_string": {  
"query": "_",  
"analyze\_wildcard": true  
}  
}  
},  
"CreateOrder": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: CreateOrder"  
}  
}  
},  
"SendOrderEmail": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: SendOrderEmail"  
}  
}  
},  
"RepriceOrder": {  
"query": {  
"query\_string": {  
"analyze\_wildcard": true,  
"query": "Method: RepriceOrder"  
}  
}  
},(REMOVED)  
}  
},  
"aggs": {  
"3": {  
"avg": {  
"field": "ElapsedMs"  
}  
}  
}  
}  
},  
"query": {  
"filtered": {  
"query": {  
"query\_string": {  
"query": "logfile: "PP-OO-ResponseTimeLog"",  
"analyze\_wildcard": true  
}  
},  
"filter": {  
"bool": {  
"must": [  
{  
"range": {  
"@timestamp": {  
"gte": 1451586600000,  
"lte": 1483208999999,  
"format": "epoch\_millis"  
}  
}  
}  
],  
"must\_not": []  
}  
}  
}  
},  
"highlight": {  
"pre\_tags": [  
"@kibana-highlighted-field@"  
],  
"post\_tags": [  
"@/kibana-highlighted-field@"  
],  
"fields": {  
"\*": {}  
},  
"fragment\_size": 2147483647  
}  
}

(Removed few buckets to fit in the response)  
If you see in the request body, there is one extra query added for \* which I guess is because of that default filter.

---

<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:** [July 6, 2017, 1:56pm UTC](https://discuss.elastic.co/t/remove-default-filter-from-aggregation/47108/5 "2017-07-06T13:56:15Z")

</div>

Closed on July 6, 2017, 1:56pm UTC


