'Elastic: mismatched input '-'

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
}


Solution 1:[1]

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
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nishikant Tayade