Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we query Kibana?

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.

like image 762
Nader Avatar asked Aug 05 '15 08:08

Nader


People also ask

What query language does Kibana use?

The Kibana Query Language (KQL) is a simple syntax for filtering Elasticsearch data using free text search or field-based search. KQL is only used for filtering data, and has no role in sorting or aggregating the data. KQL is able to suggest field names, values, and operators as you type.

How do you query Kibana logs?

In the deployment where your logs are stored, open Kibana. In the Analytics sidebar navigate to Discover. Select the data view you created, and you are ready to explore these logs in detail.


Video Answer


2 Answers

You can directly request the ES. The documentation is here

like image 138
mherbert Avatar answered Oct 17 '22 14:10

mherbert


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

like image 1
Lax Avatar answered Oct 17 '22 16:10

Lax