# Can I apply filtering in specific buckets and not in the whole visualization in Kibana?

**URL:** https://discuss.elastic.co/t/can-i-apply-filtering-in-specific-buckets-and-not-in-the-whole-visualization-in-kibana/240201
**Category:** Kibana
**Created:** [July 7, 2020, 6:35pm UTC](https://discuss.elastic.co/t/can-i-apply-filtering-in-specific-buckets-and-not-in-the-whole-visualization-in-kibana/240201 "2020-07-07T18:35:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sfenman](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@sfenman](https://discuss.elastic.co/u/sfenman)
#### Post date: [July 7, 2020, 6:35pm UTC](https://discuss.elastic.co/t/can-i-apply-filtering-in-specific-buckets-and-not-in-the-whole-visualization-in-kibana/240201/1 "2020-07-07T18:35:50Z")

</div>

I have some documents with the fields `client.ip` and `http.response.status.code` among other fields. I have also some documents with the fields `client.ip` and `company.name`.

What I want to is to create a visualization with all the `client.ip` which `http.response.status.code` is 503 and then associate them with the `company.name` field. I have tried to achieve this using filters but filters apply to all buckets in kibana visualization so that doesn't work. Is there any other way to do this ?

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [July 10, 2020, 11:16am UTC](https://discuss.elastic.co/t/can-i-apply-filtering-in-specific-buckets-and-not-in-the-whole-visualization-in-kibana/240201/2 "2020-07-10T11:16:33Z")

</div>

Would a data table with top x hits of client.ip, split by company.name and with a filter for  
503" on a scripted field that says:  
`if (!doc.containsKey(' `http.response.status.code`') || doc[' `http.response.status.code`'].empty) { return "unavailable" } else { return doc[' `http.response.status.code`'].value }" `

---

<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 7, 2020, 11:16am UTC](https://discuss.elastic.co/t/can-i-apply-filtering-in-specific-buckets-and-not-in-the-whole-visualization-in-kibana/240201/3 "2020-08-07T11:16:39Z")

</div>

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