Sam*_*vis 5 sql amazon-web-services elasticsearch kibana
此处的 AWS 文档表明支持 SQL 查询:https://aws.amazon.com/about-aws/whats-new/2019/05/amazon-elasticsearch-service-sql-support/
此页面显示语法: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/sql-support.html
POST elasticsearch_domain/_opendistro/_sql
{
"query": "SELECT * FROM my-index LIMIT 50"
}
Run Code Online (Sandbox Code Playgroud)
在 Kibana 开发工具中运行以下命令
POST my_domain/_opendistro/_sql
{
"query": "SELECT * FROM my-index LIMIT 50"
}
Run Code Online (Sandbox Code Playgroud)
给出错误
{
"error": {
"root_cause": [
{
"type": "invalid_type_name_exception",
"reason": "Document mapping type name can't start with '_', found: [_opendistro]"
}
],
"type": "invalid_type_name_exception",
"reason": "Document mapping type name can't start with '_', found: [_opendistro]"
},
"status": 400
}
Run Code Online (Sandbox Code Playgroud)
我的ElasticSearch版本是6.7。
小智 1
由于您的elasticsearch是由AWS驱动的并且您正在使用Kibana开发工具,因此您可以通过以下方式获取查询结果
POST _opendistro/_sql
{
"query": "SELECT * FROM your_index "
}
Run Code Online (Sandbox Code Playgroud)
您不需要输入域名。这对我有用。
| 归档时间: |
|
| 查看次数: |
1789 次 |
| 最近记录: |