[英]How to change change Kibana saved search (Discover) with a REST request?
我有用于搜索Kibana中特定事件的查询,该查询与其他搜索一起保存,是否可以通过REST调用以编程方式更改它?
Everything is stored in .kibana
index and you can update your settings by a put request
into elasticsearch but it's not recommended. 一切都存储在.kibana
索引中,您可以通过对.kibana
的put request
来更新设置,但不建议这样做。
You can edit your saved search in kibana/settings/objects
. 您可以在kibana/settings/objects
编辑保存的搜索。
As @Mohammad said, All metadata related to Kibana is stored under .kibana
index in elasticsearch cluster. 正如@Mohammad所说,所有与Kibana相关的元数据都存储在.kibana
集群中的.kibana
索引下。 All searches, visualization, dashboards are stored in their respective types in .kibana
index. 所有搜索,可视化,仪表板均以各自的类型存储在.kibana
索引中。 eg searches are stored under search
type in .kibana
index. 例如,搜索以.kibana
索引中的search
类型存储。
Get all searches by executing following command: 通过执行以下命令来获取所有搜索:
GET /.kibana/search/_search
{
"query": {
"match_all": {}
}
}
Retrieve search-id
for which you want to update the query from the above results. 从以上结果中检索要为其更新查询的search-id
。
Now you can update that specific search
document by using _update
API as shown below: 现在,您可以使用_update
API来更新特定的search
文档,如下所示:
POST /.kibana/search/<search-id>/_update
{
"doc" : {
"kibanaSavedObjectMeta":{ "searchSourceJSON": """{"index":"test-*","query":{"query_string":{"query":"id:2","analyze_wildcard":true}},"filter":[],"highlight":{"pre_tags":["@kibana-highlighted-field@"],"post_tags":["@/kibana-highlighted-field@"],"fields":{"*":{}},"require_field_match":false,"fragment_size":2147483647}}"""
}
}
}
Consider the following warning message from Kibana if you are not advanced user: 如果您不是高级用户,请考虑以下来自Kibana的警告消息:
Proceed with caution! 谨慎行事!
Modifying objects is for advanced users only. 修改对象仅适用于高级用户。 Object properties are not validated and invalid objects could cause errors, data loss, or worse. 对象属性未经验证,无效对象可能会导致错误,数据丢失或更糟。 Unless someone with intimate knowledge of the code told you to be in here, you probably shouldn't be. 除非对代码有深入了解的人告诉您进入此处,否则您可能不应该进入。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.