# X-pack 6.3 sql query

**URL:** https://discuss.elastic.co/t/x-pack-6-3-sql-query/137765
**Category:** Elasticsearch
**Tags:** elastic-stack-sql
**Created:** [June 28, 2018, 8:54am UTC](https://discuss.elastic.co/t/x-pack-6-3-sql-query/137765 "2018-06-28T08:54:06Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![suhan\_kim](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@suhan\_kim](https://discuss.elastic.co/u/suhan_kim)
#### Post date: [June 28, 2018, 8:54am UTC](https://discuss.elastic.co/t/x-pack-6-3-sql-query/137765/1 "2018-06-28T08:54:06Z")

</div>

curl -X POST "[http://localhost:9200/\_xpack/sql?format=json](http://localhost:9200/_xpack/sql?format=json)" -H 'Content-Type: application/json' -d'  
{  
"query": "SELECT \* FROM logstash-2018.06.28"  
}  
'  
{"error":{"root\_cause":[{"type":"parsing\_exception","reason":"line 1:23: mismatched input '-' expecting {, ',', 'FULL', 'GROUP', 'HAVING', 'INNER', 'JOIN', 'LEFT', 'LIMIT', 'NATURAL', 'ORDER', 'RIGHT', 'WHERE'}"}],"type":"parsing\_exception","reason":"line 1:23: mismatched input '-' expecting {, ',', 'FULL', 'GROUP', 'HAVING', 'INNER', 'JOIN', 'LEFT', 'LIMIT', 'NATURAL', 'ORDER', 'RIGHT', 'WHERE'}","caused\_by":{"type":"input\_mismatch\_exception","reason":null}},"status":400}

You can not use escape( \ ).  
why ?

---

<div class="post-metadata">

### Author: ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)
#### Post date: [June 28, 2018, 9:11am UTC](https://discuss.elastic.co/t/x-pack-6-3-sql-query/137765/2 "2018-06-28T09:11:58Z")

</div>

Hi

Since the index name contains reserved SQL characters (`-`), you need to escape the index name. Try

```auto
curl -X POST "http://localhost:9200/_xpack/sql?format=json" -H 'Content-Type: application/json' -d'
{
"query": "SELECT * FROM \"logstash-2018.06.28\""
}
'

```

---

<div class="post-metadata">

### Author: ![suhan\_kim](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@suhan\_kim](https://discuss.elastic.co/u/suhan_kim)
#### Post date: [June 28, 2018, 9:18am UTC](https://discuss.elastic.co/t/x-pack-6-3-sql-query/137765/3 "2018-06-28T09:18:17Z")

</div>

Hi, Thank you for answer.

curl -X POST "[http://localhost:9200/\_xpack/sql?format=json](http://localhost:9200/_xpack/sql?format=json)" -H 'Content-Type: application/json' -d'  
{  
"query": "SELECT \* FROM "logstash-2018.06.28""  
}  
'

{  
"error": {  
"root\_cause": [  
{  
"type": "sql\_illegal\_argument\_exception",  
"reason": "Arrays (returned by [tags]) are not supported"  
}  
],  
"type": "sql\_illegal\_argument\_exception",  
"reason": "Arrays (returned by [tags]) are not supported"  
},  
"status": 500  
}

why ?

---

<div class="post-metadata">

### Author: ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)
#### Post date: [June 28, 2018, 9:20am UTC](https://discuss.elastic.co/t/x-pack-6-3-sql-query/137765/4 "2018-06-28T09:20:28Z")

</div>

Please use :

```auto
"query": "SELECT * FROM \"logstash-2018.06.28\""

```

and not

```auto
"query": "SELECT * FROM "logstash-2018.06.28""

```

mind the `\` escaping the `"` in your POST body.

---

<div class="post-metadata">

### Author: ![suhan\_kim](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@suhan\_kim](https://discuss.elastic.co/u/suhan_kim)
#### Post date: [June 28, 2018, 9:24am UTC](https://discuss.elastic.co/t/x-pack-6-3-sql-query/137765/5 "2018-06-28T09:24:55Z")

</div>

Sorry I wrote wrong.  
You can not use escape.

curl -X POST "[http://localhost:9200/\_xpack/sql?format=json](http://localhost:9200/_xpack/sql?format=json)" -H 'Content-Type: application/json' -d'  
{  
"query": "SELECT \* FROM "logstash-2018.06.28""  
}  
'

response error  
{  
"error": {  
"root\_cause": [  
{  
"type": "sql\_illegal\_argument\_exception",  
"reason": "Arrays (returned by [tags]) are not supported"  
}  
],  
"type": "sql\_illegal\_argument\_exception",  
"reason": "Arrays (returned by [tags]) are not supported"  
},  
"status": 500  
}

---

<div class="post-metadata">

### Author: ![suhan\_kim](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@suhan\_kim](https://discuss.elastic.co/u/suhan_kim)
#### Post date: [June 28, 2018, 9:56am UTC](https://discuss.elastic.co/t/x-pack-6-3-sql-query/137765/6 "2018-06-28T09:56:45Z")

</div>

Thank, Resolved.  
The index of today's date should not be.

---

<div class="post-metadata">

### Author: ![Andrei\_Stefan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei_stefan/32/47533_2.png) [@Andrei\_Stefan](https://discuss.elastic.co/u/Andrei_Stefan)
#### Post date: [June 28, 2018, 11:34am UTC](https://discuss.elastic.co/t/x-pack-6-3-sql-query/137765/7 "2018-06-28T11:34:36Z")

</div>

Also, regarding the error about arrays - Elasticsearch SQL doesn't support them at the moment.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 26, 2018, 11:34am UTC](https://discuss.elastic.co/t/x-pack-6-3-sql-query/137765/8 "2018-07-26T11:34:37Z")

</div>

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