我是 elasticsearch 的新手,我想删除我的 elasticsearch 索引中超过 10 天的文档。我只想保留最近 10 天的数据。所以有什么办法可以自动删除最后 11 天的索引。我试过的..
DELETE logstash-*/_query
{
"query": {
"range": {
"@timestamp": {
"lte": "now-10d"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我在 kibana 开发工具上运行时遇到的错误
{
"error": "Incorrect HTTP method for uri [/logstash-*/_query?pretty] and method [DELETE],
allowed: [POST]",
"status": 405
}
Run Code Online (Sandbox Code Playgroud)
请帮助解决此问题。