How to get sql rest api working from kibana?

Hello everyone ,

i'm trying with sql rest api
my elasticsearch version is 6.2.4.
after installed xpack for both es and kibana ,i tried the following command from kibana dev tools, it give me the error below .
Also i didn't see sql-cli in bin/x-pack folder ,i installed x-pack by bin/elasticsearch-plugin install x-pack command , did I miss anything ?any suggestion would be appreciate.thanks.

POST /_xpack/sql?format=txt
{
    "query": "SELECT * FROM library ORDER BY page_count DESC LIMIT 5"
}

{
"error": {
"root_cause": [
{
"type": "invalid_index_name_exception",
"reason": "Invalid index name [xpack], must not start with '', '-', or '+'",
"index_uuid": "na",
"index": "_xpack"
}
],
"type": "invalid_index_name_exception",
"reason": "Invalid index name [xpack], must not start with '', '-', or '+'",
"index_uuid": "na",
"index": "_xpack"
},
"status": 400
}

The SQL API is not available in 6.2.
If you check the top of the doc you linked to, it says

You are looking at preliminary documentation for a future release

SQL is planned for release as part of 6.3

thank you Tim, that's explained everything :grin:

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