Get current filters and time range from custom visualization

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.

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!

Do you mean something like this?

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

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!

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