elasticsearch-dataformat icon indicating copy to clipboard operation
elasticsearch-dataformat copied to clipboard

How to convert template query to search query?

Open StephanBeutel opened this issue 10 years ago • 1 comments

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.

StephanBeutel avatar Jan 31 '16 15:01 StephanBeutel

I do not think that dataformat plugin supports it at the moment...

marevol avatar Jan 31 '16 21:01 marevol