Yes ... please look at the docs and try
There is a nice example here
Example I loaded the sample web logs which comes with every elasticsearch installation
POST /_sql?format=csv
{
"query": "SELECT host, clientip, url FROM kibana_sample_data_logs WHERE host = 'www.elastic.co' AND url = 'https://www.elastic.co/downloads/apm' LIMIT 15"
}
# Result
host,clientip,url
www.elastic.co,184.19.167.161,https://www.elastic.co/downloads/apm
www.elastic.co,104.32.0.154,https://www.elastic.co/downloads/apm
www.elastic.co,4.167.5.34,https://www.elastic.co/downloads/apm
www.elastic.co,190.234.218.253,https://www.elastic.co/downloads/apm
www.elastic.co,157.4.76.38,https://www.elastic.co/downloads/apm
www.elastic.co,96.199.208.145,https://www.elastic.co/downloads/apm
www.elastic.co,23.203.186.61,https://www.elastic.co/downloads/apm
www.elastic.co,187.105.79.140,https://www.elastic.co/downloads/apm
www.elastic.co,255.205.14.152,https://www.elastic.co/downloads/apm
www.elastic.co,198.72.109.109,https://www.elastic.co/downloads/apm
www.elastic.co,1.149.149.212,https://www.elastic.co/downloads/apm
www.elastic.co,215.67.92.140,https://www.elastic.co/downloads/apm
www.elastic.co,187.55.100.154,https://www.elastic.co/downloads/apm
www.elastic.co,243.233.91.124,https://www.elastic.co/downloads/apm
www.elastic.co,179.153.116.46,https://www.elastic.co/downloads/apm
Results
and translate so you can see...
POST /_sql/translate
{
"query": "SELECT host, clientip, url FROM kibana_sample_data_logs WHERE host = 'www.elastic.co' AND url = 'https://www.elastic.co/downloads/apm' LIMIT 15"
}
# Result
{
"size": 15,
"query": {
"bool": {
"must": [
{
"term": {
"host.keyword": {
"value": "www.elastic.co"
}
}
},
{
"term": {
"url.keyword": {
"value": "https://www.elastic.co/downloads/apm"
}
}
}
],
"boost": 1
}
},
"_source": false,
"fields": [
{
"field": "host"
},
{
"field": "clientip"
},
{
"field": "url"
}
],
"sort": [
{
"_doc": {
"order": "asc"
}
}
],
"track_total_hits": -1
}