How can we request Kibana with REST API to get the visualization request and response?
Like this:
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.
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.
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.
You can directly request the ES. The documentation is here
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With