We've been using Kibana (v6.4) for a while and found a way of integrating the application as an Iframe in our web application.
We got a new requirement where the user saves a "Search" and then we reuse the results of that search for internal tasks.
I saw the Kibana Object API, and I can retrieve the searches an User has stored, but it returns a result like:
{
"id": "2e3fd100-3618-11e9-a719-419d60b7873d",
"type": "search",
"updated_at": "2019-02-21T20:35:09.456Z",
"version": 1,
"attributes": {
"title": "Carlos Search",
"description": "",
"hits": 0,
"columns": [
"billingProduct"
],
"sort": [
"createdOn",
"desc"
],
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"index\":\"e8ec21c0-f996-11e8-950b-03302d77bc99\",\"highlightAll\":true,\"version\":true,\"query\":{\"language\":\"lucene\",\"query\":\"\"},\"filter\":[{\"meta\":{\"negate\":false,\"index\":\"e8ec21c0-f996-11e8-950b-03302d77bc99\",\"type\":\"phrase\",\"key\":\"eventStatus\",\"value\":\"DELIVRD\",\"params\":{\"query\":\"DELIVRD\",\"type\":\"phrase\"},\"disabled\":false,\"alias\":null},\"query\":{\"match\":{\"eventStatus\":{\"query\":\"DELIVRD\",\"type\":\"phrase\"}}},\"$state\":{\"store\":\"appState\"}}]}"
}
}
}
If I want to use the searchSourceJSON directly into ElasticSearch it needs to be modified and still it doesn't have all the filters / Columns the user used when saving the "Search".
Is there a way to get the queries that Kibana executes when searching to be reused later on directly onto ElasticSearch?