Accessing filters applied for custom kibana visualization plugin

Hello All,

I have a plugin which uses my own es REST service to get data and I am able to use "ui/filter_manager" to add filters to dashboard using add method.
But by this , i would be able to apply my visualization filter to dashboard but i also need to apply filters applied from other visualization onto my viz. So, what I expect is some variable
that would be saving filters that i unable to find till now.
Or last approach could be extracting match/query_string from browser url and firing queries as filter changes in url ???

I also tried accessing

var queryFilter = Private(require('ui/filter_bar/query_filter'));

But got blank lists for getAppFilters/getFilters/getGlobalFilters functions.

Hey Tarun,

It sounds like you're doing the right thing. This should work:

import FilterBarQueryFilterProvider from 'ui/filter_bar/query_filter';

// Somewhere in your directive, service, or controller
const queryFilter = Private(FilterBarQueryFilterProvider);
queryFilter.getFilters(); // returns array of **pinned** filters

If you're still stumped, try asking on our IRC channel.


Thanks @cjcenizal , It seemed scope issue and has been fixed :slight_smile:
I need to apply filters as well as searches on plugins from dashboard.
So, I urgently need help to extract searches made on kibana dashboard in my viz.

@cjcenizal I urgently need help on this ..please help

@JuanCarniglia @spalger and @timroes , please help on problem :-
I have been trying
import stateQueryImport from 'ui/utils/query_string';

which provides below functions :
replaceParamInUrl(url, param, newVal)

I tried findInUrl('query_string') or findInUrl('query') and findInUrl('title') etc.
But , Have not got search query from this. I dont this i am trying a correct library :frowning:

Hey Tarun, I'm afraid I don't have an answer to your question right now and it would take some digging in the code for me to figure out a solution to your problem. Unfortunately, I'm swamped with work and don't have time to help out just now. Have you tried asking around on our IRC channel? Barring that, have you tried searching the codebase for examples of the functionality you're looking for? For example, the Visualize app must have some way of extracting information from the query string. Perhaps you could start looking there?

I wish I could be of more help... I'm sorry I can't help more right now!


Thanks a lot @cjcenizal , yes i did try irc but no one replied , is there a time zone irc support is available ?
Ok i would check visualize library , should be helpful definitely.
But i really appreciate your sincere support from deep of my heart :slight_smile:

Also, I would try tagging a few more , kibana plugin
Developers i know... May @timroes or @JuanCarniglia or @spalger help me on this as i do need a solution urgently

Best regards
Tarun Kumar

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