# Extending filter bar functionality

**URL:** <https://discuss.elastic.co/t/extending-filter-bar-functionality/119676>\
**Category:** Kibana\
**Created:** [February 13, 2018, 4:41pm UTC](https://discuss.elastic.co/t/extending-filter-bar-functionality/119676 "2018-02-13T16:41:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alepuccetti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alepuccetti/32/20174_2.png) [@alepuccetti](https://discuss.elastic.co/u/alepuccetti)\
**Post date:** [February 13, 2018, 4:41pm UTC](https://discuss.elastic.co/t/extending-filter-bar-functionality/119676/1 "2018-02-13T16:41:31Z")

</div>

It would be useful to improve data analytics functionality having a filter functionality that creates a filter matching all the value of a specific field for the current view.

Use case:  
View all the document produced by entities (hosts, container, users, etc...) that have a specific behavior.

Practical example:  
See all the documents created by a group of hosts that created a specific kind of error in a certain timeframe.

At the current state of Kibana, you have to find all these host ids and create a filter to match those ids manually.

It would be nice to have a filter type that will do this for you:

Select field name.  
Select the new filter type (e.g. values), optionally set the top N hit.  
Save. At this point, Kibana should run a query to get these ids by running a query with the current filter and time settings and build a filtered query.  
Now you can deactivate all the other filters and you will see all the document produced by the hots identified by the first analysis.

From the Github issue: [https://github.com/elastic/kibana/issues/16702](https://github.com/elastic/kibana/issues/16702)

I am currently working on this but I am not very familiar with JavaScript and Kibana internal, so any help or direction would be great.

What I am struggling with:

1. Get the Elasticsearch client to run the query.
2. Run the query to get the IDs with the current state of filter and time picker.

Any help will be deeply appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [February 13, 2018, 7:52pm UTC](https://discuss.elastic.co/t/extending-filter-bar-functionality/119676/2 "2018-02-13T19:52:34Z")

</div>

Interesting idea @alepuccetti, I'll keep my responses to the github issue.

---

<div class="post-metadata">

**Author:** ![alepuccetti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alepuccetti/32/20174_2.png) [@alepuccetti](https://discuss.elastic.co/u/alepuccetti)\
**Post date:** [February 13, 2018, 8:01pm UTC](https://discuss.elastic.co/t/extending-filter-bar-functionality/119676/3 "2018-02-13T20:01:53Z")

</div>

I hope I will have a POC in a week. I will be at Elastic{ON} end of February in San Francisco, we could talk about this in person and I can show you some of our use cases.

---

<div class="post-metadata">

**Author:** ![alepuccetti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alepuccetti/32/20174_2.png) [@alepuccetti](https://discuss.elastic.co/u/alepuccetti)\
**Post date:** [February 15, 2018, 11:20am UTC](https://discuss.elastic.co/t/extending-filter-bar-functionality/119676/4 "2018-02-15T11:20:42Z")

</div>

What I am trying to achieve is very similar to what is done in `registerValueSuggestions` but instead of getting some suggestions I want to get out all the values (optionally with an upper bound limit). The other difference is that I want to get those value within the current context (applying time restriction and filters to the suggestion query).

---

<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:** [March 15, 2018, 11:20am UTC](https://discuss.elastic.co/t/extending-filter-bar-functionality/119676/5 "2018-03-15T11:20:51Z")

</div>

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