Home > Blockchain >  Elastic: mismatched input '-'
Elastic: mismatched input '-'

Time:03-18

I'm running this code and I'm getting this error and I just can't figure out what's wrong with it:

POST /_sql/translate
{
  "query": "SELECT duracao, elementoRede, hostname, ingest_time FROM reta-* WHERE duracao > 0 ORDER BY duracao DESC LIMIT 10",
  "fetch_size": 100
}

CodePudding user response:

You need to escape the special character, try this

POST /_sql/translate
{
  "query": "SELECT duracao, elementoRede, hostname, ingest_time FROM \"reta-*\" WHERE duracao > 0 ORDER BY duracao DESC LIMIT 10",
  "fetch_size": 100
}
  • Related