SQL Query : Indice vs Tables

Hi everyone,
I trying to use SQL on elasticsearch. (ver 7.1)
I have some index : web-access-2019.07, web-access-2019.08, web-access-2019.09.
So how to use sql to query into three index above.

I try with query :

POST _sql
{
  "query":"DESCRIBE web-access-2019.07"
} 

And i got error

{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "line 1:13: mismatched input '-' expecting <EOF>"
      }
    ],
    "type": "parsing_exception",
    "reason": "line 1:13: mismatched input '-' expecting <EOF>",
    "caused_by": {
      "type": "input_mismatch_exception",
      "reason": null
    }
  },
  "status": 400
}

And with query got same error

POST _sql
{
  "query":"DESCRIBE web-access*"
}

So what do i need to query into my index?

Thank!

Could you try something like:

POST _sql
{
  "query":"DESCRIBE \"web-access-2019.07\""
} 
1 Like

It worked!. Thank so much.
So now i want to query all index web-access-*. I try with this query, i worked too!

POST _sql
{
  "query":"DESCRIBE \"web-access-*\""
} 

That include web-access-2019.07, .... web-access-xxxxx.ww right?

Yes.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.