通过sql查询es数据

环境:
ES版本:6.5

1.查询索引
curl -H "Content-Type: application/json" -XPOST "http://192.168.1.135:19200/_xpack/sql?format=txt&pretty" -d'
{
    "query": "SELECT * FROM vacc_update where id=1",
    "fetch_size": 5
}
'

2.通过命令行模式查询
./elasticsearch-sql-cli http://elastic:elastic@192.168.1.135:19200 ##带账号密码的
./elasticsearch-sql-cli http://192.168.1.135:19200 ##不带账号密码的

posted @ 2019-10-23 17:08  slnngk  阅读(3413)  评论(1编辑  收藏  举报