elasticsearch-dataformat
elasticsearch-dataformat copied to clipboard
How to convert template query to search query?
Hi, I try to convert a template query to a search query to use the csv converter.
My template query looks like this:
curl -XGET 'localhost:9200/logstash-*/_search/template?pretty' -d '
{
"file": "yJmeterResult"
}'
Regrading to QueryDSL documentation, the search query for the template should look like this: (https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-template-query.html)
curl -XGET 'localhost:9200/logstash-*/_search' -d '
{
"query": {
"template": {
"file": "yJmeterResult"
}
}
}'
But I only get an error:
RemoteTransportException[[Everyman][localhost/127.0.0.1:9300][indices:data/read/search[phase/query]]]; nested: SearchParseException[failed to parse search source [
{
"query": {
"template": {
"file": "yJmeterResult"
}
}
}]]; nested: QueryParsingException[[_na] query malformed, no field after start_object]; }
Any hints how the search query must look like to execute the template?
Thanks for help.
I do not think that dataformat plugin supports it at the moment...