# SQL Query special chars

**URL:** <https://discuss.elastic.co/t/sql-query-special-chars/148595>\
**Category:** Elasticsearch\
**Created:** [September 14, 2018, 9:51am UTC](https://discuss.elastic.co/t/sql-query-special-chars/148595 "2018-09-14T09:51:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumpelblase](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumpelblase/32/35709_2.png) [@kumpelblase](https://discuss.elastic.co/u/kumpelblase)\
**Post date:** [September 14, 2018, 9:51am UTC](https://discuss.elastic.co/t/sql-query-special-chars/148595/1 "2018-09-14T09:51:58Z")

</div>

Hi there  
I have a index called "index-460". When I do SQL query request like:

> ```
> POST _xpack/sql
> {
> "query":"DESCRIBE index-460"
> }
> 
> ```

I get the response:

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

How can I get around this error? Renaming the index isn't really an option.  
Is there any way I can set index-460 explicit as a string?

---

<div class="post-metadata">

**Author:** ![kumpelblase](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumpelblase/32/35709_2.png) [@kumpelblase](https://discuss.elastic.co/u/kumpelblase)\
**Post date:** [September 17, 2018, 11:49am UTC](https://discuss.elastic.co/t/sql-query-special-chars/148595/2 "2018-09-17T11:49:08Z")

</div>

I found the problem. I had to enclose the index with `"` and then escape it with `\"`.  
At the end the query looked like this:

```auto
POST _xpack/sql
 {
   "query":"DESCRIBE \"index-460\""
 }

```

---

<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:** [October 15, 2018, 11:49am UTC](https://discuss.elastic.co/t/sql-query-special-chars/148595/3 "2018-10-15T11:49:13Z")

</div>

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