# Intercept all requests from Kibana to Elasticsearch by using the plugin

**URL:** <https://discuss.elastic.co/t/intercept-all-requests-from-kibana-to-elasticsearch-by-using-the-plugin/240507>\
**Category:** Kibana\
**Created:** [July 9, 2020, 10:19am UTC](https://discuss.elastic.co/t/intercept-all-requests-from-kibana-to-elasticsearch-by-using-the-plugin/240507 "2020-07-09T10:19:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uldis\_Liepins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/uldis_liepins/32/71865_2.png) [@Uldis\_Liepins](https://discuss.elastic.co/u/Uldis_Liepins)\
**Post date:** [July 9, 2020, 10:19am UTC](https://discuss.elastic.co/t/intercept-all-requests-from-kibana-to-elasticsearch-by-using-the-plugin/240507/1 "2020-07-09T10:19:40Z")

</div>

Hi,

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](https://discuss.elastic.co/t/intercept-every-request-from-kibana-plugin/229021)) 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!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 6, 2020, 10:19am UTC](https://discuss.elastic.co/t/intercept-all-requests-from-kibana-to-elasticsearch-by-using-the-plugin/240507/2 "2020-08-06T10:19:46Z")

</div>

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