我正在尝试以编程的方式为Opensearch中的仪表板创建一个index_pattern。
由于我在Opensearch文档中没有发现任何与其相关的内容,所以我尝试了弹性搜索saved_objects api:
POST /api/saved_objects/index-pattern/my_index_pattern
{
"attributes":{
"title": "my_index"
}
}但是,当我调用它时,我得到了以下错误:
{
"error" : "no handler found for uri [/api/saved_objects/index-pattern/my_index_pattern?pretty=true] and method [POST]"
}我该怎么解决呢?是否有不同的要求Opensearch来创建一个index_pattern
发布于 2022-04-14 08:30:19
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"
}
}'这个对我有用
https://stackoverflow.com/questions/71770187
复制相似问题