Fix: Quote the index pattern in SQL input (#25488)

SQL requires that you quote the index name if you are using special characters (like *, with an index pattern). Our default value didn't work since `logstash*` was not quoted.

### Before

![screenshot 2018-11-09 13 03 21](https://user-images.githubusercontent.com/404731/48285446-db599380-e41f-11e8-85cc-320b03a004b0.png)

### After

![screenshot 2018-11-09 13 34 18](https://user-images.githubusercontent.com/404731/48286844-2c6b8680-e424-11e8-9329-435adbe9dc06.png)

...and if you select some valid fields so you don't get an array in the results:

![screenshot 2018-11-09 13 34 48](https://user-images.githubusercontent.com/404731/48286891-49a05500-e424-11e8-8d66-4c9ac208d358.png)
This commit is contained in:
Joe Fleming 2018-11-09 16:12:23 -07:00 committed by GitHub
parent 83369770c6
commit 50eb9e6ef4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ class EssqlDatasource extends PureComponent {
else this.props.setInvalid(!query.trim());
}
defaultQuery = 'SELECT * FROM logstash*';
defaultQuery = 'SELECT * FROM "logstash*"';
getQuery = () => getSimpleArg(this.getArgName(), this.props.args)[0];