Find/Intercept query from visualization plugin

Hi all,

I am learning a little bit about Kibana 5.x and as an exercise I am creating some visualizations. To the date I have had some success playing with filters and aggregations, and now I am trying to make an 'inspector' visualization which does something like the spy_mode.

I have created a new 'spy' to intercept the request and response, and it works fine except for the fact that it runs only when the spy panel is shown.

So my question is: how can a visualization plugin obtain the request object? Is there any 'event' I can watch to, or an UI module that I can use to get it?

Thank you very much for your help and the amazing Kibana!

I think searchSource should be available on scope, which holds all that info (request, response, ... ). You can try looking there and see if it helps you.

Hi Marius,

Thank you for your help. Unfortunately, I am not able to find any searchSource in the visualization scope.

I'll investigate on that in the core plugins. Any help would be much appreciated.

Thanks,

David

Could you try in $scope.$parent.savedSearch then? Should be somewhere around here.
Otherwise, check the existing spy modes core_plugins/spy_modes

No luck :frowning:

I can't find a reference to the searchSource anywhere in a basic visualization plugin. I guess it can be injected somehow.

I'll keep investigating, if I find it I will post it here for future reference, it seems that this is a quite recurrent question.

Cheers,

David

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