我正在尝试以编程方式在 Opensearch 中创建index_pattern仪表板。
由于我在 Opensearch 文档中没有找到任何与之相关的内容,因此我尝试了elastic search saved_objectsapi:
POST /api/saved_objects/index-pattern/my_index_pattern
{
"attributes":{
"title": "my_index"
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我调用它时,出现以下错误:
{
"error" : "no handler found for uri [/api/saved_objects/index-pattern/my_index_pattern?pretty=true] and method [POST]"
}
Run Code Online (Sandbox Code Playgroud)
我该如何解决?Opensearch 是否有不同的要求来创建index_pattern?
小智 1
curl -k -X POST http://<host>:5601/api/saved_objects/index-pattern/logs-* -H "osd-xsrf:true" -H "content-type:application/json" -d '
{
"attributes": {
"title": "logs-*",
"timeFieldName": "@timestamp"
}
}'
Run Code Online (Sandbox Code Playgroud)
这对我有用
| 归档时间: |
|
| 查看次数: |
2903 次 |
| 最近记录: |