Ignore Global Filters in Custom Plugin - Kibana 5.5


(Ronel) #1

I see that some of the plugins, like Visual Builder, have an option to ignore global filters.

How can a custom plugin (a plugin that I write myself) that uses search, say a modified version of Table Vis achieve the same thing? I looked in the code and there's no easy way to do it. Can you please point me where to start and how to achieve it?


(kulkarni) #2

First lets start with the basics...have you looked at few of our blogs which show you ways to build your own custom plugins:
https://www.elastic.co/elasticon/conf/2016/sf/how-to-build-your-own-kibana-plugins

Apart from the link above, there's been some tutorials by community members, e.g. https://www.timroes.de/2015/12/02/writing-kibana-4-plugins-basics/381. That one applies to Kibana 4 as well, but changes are reasonably minimal between 4 and 5.

I would also check out some examples; many use the same templates. https://github.com/elastic/kibana/wiki/Known-Plugins458

see if this helps, else we can guide u more on actual disabling of global filters . You would have to hack the code to suit ur needs.

Thanks
Rashmi


(Ronel) #3

We were able to author our own plugins. I know I have to hack the code to suit our needs.

Is it achievable what I am asking?

Basically I have to have a version of Table Vis where global filters don't apply to it, but of course global filters will work as normal for others.

Thanks in advance!


(Ronel) #4

My investigation leads me to this file. Is SearchSourceProvider context aware? Does it know which vis it's currently on?

Thanks,
Ronel


(Brandon Kobel) #5

@ronelfernandez by default, all Search Sources's inherit from the "global search source" which has the timefilter as well as the pinned filters.

If you have access to the search source for the table vis, you can do something like what we do here
to exclude certain filters.


(Ronel) #6

Ok thanks Brandon! Will that work for 5.5?


(Brandon Kobel) #7

It will not, we implemented the addFilterPredicate functionality recently. You could also potentially use the SearchSource.inherits(null) method, which will stop all search source inheritance, but that will exclude the global time filters as well, so you'd have to find a way to specify those.


(Ronel) #8

Ok thanks for your quick replies Brandon!


(system) #9

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