The SQL REST API accepts a SQL statement in JSON format, executes it, and returns a response. The endpoint of the SQL REST API is shown in the following code block. You should use a parameter query with a SQL statement in the request body:
POST /_sql?format=response_format
{
"query": "....",
"parameter_x": parameter_x_value
}
Now, let's use the Kibana console to practice some examples outlined under the Query DSL section of Chapter 6, Search APIs:
- To use the Kibana console from dev_tools, click on the button with the wrench icon on the left-hand sidebar, as shown in the following screenshot:
- Then, type the SQL statement to retrieve all the records from the cf_etf index, as described in the following code block, in the left-hand panel and click on the green arrow button in the top-right corner of the panel:
POST...