Intercept all requests from Kibana to Elasticsearch by using the plugin


I am trying to intercept all requests coming from browser to _msearch (e.g. _msearch?rest_total_hits_as_int=true&ignore_throttled=true) by using the plugin.

The idea is to be able to add additional search parameter to each Elasticsearch query (e.g. userId), so in the response, I get the data which only belongs to the specific user.

I was following the discussion in this thread (Intercept every request from Kibana plugin) but I was not able to succeed. When adding npSetup.core.http.intercept() to index.js, I am getting Cannot read property 'http' of null, but if I put it inside hack.js, it is not getting called.

Is there a way to do it? I would appreciate any help.
I am using Kibana 7.4.1.
Thank you!

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