Hi,
I am trying to extract pivoted data from ES using Logstash. It works on Kibana but not on Logstash.
`Error: [400] {"error":{"root_cause":[{"type":"parsing_exception","reason":"Unknown key for a VALUE_STRING in [query].","line":1,"col":10}],"type":"parsing_exception","reason":"Unknown key for a VALUE_STRING in [query].","line":1,"col":10},"status":400}`
input {
elasticsearch {
hosts => "localhost:9200"
index => "myindex"
query => '
{"query":
"select * from (select A,B, key, value from myindex) pivot(sum(value) for key in (\"Value1\") )"
}
'
}
}
This works in Kibana. The only difference is the single quote.
POST /_sql?format=txt
{
"query": "select * from (select A, B, key, value from myindex) pivot(sum(value) for key in ('Value1') )"
}