Hello everyone!
I am working on a project that uses saved search objects in Kibana to construct queries to Elasticsearch queries. I have successfully been able to extract titles, columns, and sort details from saved search objects and inject them into a template query I am using to return raw data from the cluster - woot!
My last step in this project is snagging the "must" and "must not" objects used for filtering specific values from the KibanaSavedObjectMeta. I guess I'm currently stuck figuring out how to parse the "searchSourceJSON" into an object so I can grab the field values I need to filter on for each specific saved search. Could someone offer me some insight on how to correctly go about this?
Just for reference, this is the current template query I am building on using extracted objects
REQUEST BODY QUERY:
{
"query": {
"filtered": {
"query": {
"query_string": {
"analyze_wildcard": true,
"query": "*",
"lowercase_expanded_terms": false
}
},
"filter": {
"bool": {
"must": [
],
"must_not": [
]
}
}
}
},
"size": 50000,
"sort": [
],
"_source": ["*"]
};
And a quick thank you to the Elastic team! Your documentation and personal replies have been incredibly helpful. Cheers to you all!