How can we query Kibana?

2019-04-06 07:42发布

How can we request Kibana with REST API to get the visualization request and response?

Like this: screenshot

I want to do that using NodeJS to manipulate this results of Kibana. The purpose is that I want to directly query Kibana programmatically (via REST API) to get the ES request body.

2条回答
Animai°情兽
2楼-- · 2019-04-06 08:22

You can directly request the ES. The documentation is here

查看更多
贼婆χ
3楼-- · 2019-04-06 08:26

You can go to kibana\kibana-4.5.1-windows\optimize\bundles\kibana.bundle.js file, search the function "Transport.prototype.request = function (params, cb)", and add in the first line parent.postMessage(params.body, "*"); Now go to the controller or script that manage the iframe(iframe parent) and add

$window.addEventListener("message", function (event) {          
              var data=event.data;          
            });

for example:

    <iframe id="ifr" src="http://localhost:5601/goto/6ba8a6b8ceef3tyt454789e4fe5cf5"></iframe>

    <script>
        $window.addEventListener("message", function (event) {          
          var data=event.data;          
        });
    </script

Now you will get the request query

查看更多
登录 后发表回答