# Get current filters and time range from custom visualization

**URL:** <https://discuss.elastic.co/t/get-current-filters-and-time-range-from-custom-visualization/144712>\
**Category:** Kibana\
**Created:** [August 16, 2018, 11:58am UTC](https://discuss.elastic.co/t/get-current-filters-and-time-range-from-custom-visualization/144712 "2018-08-16T11:58:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonaven](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonaven/32/34551_2.png) [@jonaven](https://discuss.elastic.co/u/jonaven)\
**Post date:** [August 16, 2018, 11:58am UTC](https://discuss.elastic.co/t/get-current-filters-and-time-range-from-custom-visualization/144712/1 "2018-08-16T11:58:10Z")

</div>

Hey,

I need a button visualization, which sends all current filters and the chosen time range to a backend.  
I already got the button by taking Chris Fischers [kibana-button-vis](https://github.com/chrisfischer/kibana-button-vis).

How can I get the filters and time range from the visualization controller?  
I found this:

```
import FilterBarQueryFilterProvider from 'ui/filter_bar/query_filter';
const queryFilter = Private(FilterBarQueryFilterProvider);
queryFilter.getFilters(); // returns array of **pinned** filters

```

but didn't get it to work, because the **Private** seems to be not accessible in the controller?  
(sorry i know very little about javascript, jquery and angular)

It would be perfect to get the corresponding lucene query.

Thank you so much!

---

<div class="post-metadata">

**Author:** ![a5a](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@a5a](https://discuss.elastic.co/u/a5a)\
**Post date:** [August 16, 2018, 4:09pm UTC](https://discuss.elastic.co/t/get-current-filters-and-time-range-from-custom-visualization/144712/2 "2018-08-16T16:09:34Z")

</div>

Do you mean something like this?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/9/79f25b58274ef546bfec9ab2fb68d8023c3d6124.png)

When you open your visualization, you can select `Inspect` from the top menu. Then `View: Requests` from the top again.

---

<div class="post-metadata">

**Author:** ![jonaven](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonaven/32/34551_2.png) [@jonaven](https://discuss.elastic.co/u/jonaven)\
**Post date:** [August 16, 2018, 6:10pm UTC](https://discuss.elastic.co/t/get-current-filters-and-time-range-from-custom-visualization/144712/3 "2018-08-16T18:10:17Z")

</div>

Yeah, that's exactly the information I'm talking about.  
However, I would like to receive it for further processing in the code of the controller.  
Is there a way to do this?  
Any Javascript method to receive this?  
Thanks for your support!

---

<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:** [September 13, 2018, 6:21pm UTC](https://discuss.elastic.co/t/get-current-filters-and-time-range-from-custom-visualization/144712/4 "2018-09-13T18:21:39Z")

</div>

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