Elasticsearch 删除带有特殊字符的索引

Elasticsearch 删除带有特殊字符的索引

不幸的是我在 Elasticsearch 中创建了一个名为“%{[@metadata][beat]}-2016.11.17”的索引

有什么想法可以删除它并且不会遇到特殊字符的问题吗?

我在控制台上尝试过:

curl -XDELETE -g '10.108.72.213:9200/%{[@metadata][beat]}-2016.11.18?pretty'
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "invalid escape sequence `%{[' at index 0 of: %{[@metadata][beat]}-2016.11.18"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "invalid escape sequence `%{[' at index 0 of: %{[@metadata][beat]}-2016.11.18"
  },
  "status" : 400
}

在 kibana 开发工具控制台上:

DELETE %{[@metadata][beat]}-2016.11.18/
{
  "error": {
    "root_cause": [
      {
        "type": "index_not_found_exception",
        "reason": "no such index",
        "index_uuid": "_na_",
        "resource.type": "index_or_alias",
        "resource.id": "%7B[@metadata][beat]}-2016.11.18",
        "index": "%7B[@metadata][beat]}-2016.11.18"
      }
    ],
    "type": "index_not_found_exception",
    "reason": "no such index",
    "index_uuid": "_na_",
    "resource.type": "index_or_alias",
    "resource.id": "%7B[@metadata][beat]}-2016.11.18",
    "index": "%7B[@metadata][beat]}-2016.11.18"
  },
  "status": 404
}

有任何想法吗?

答案1

您可能会发现 URL 编码版本更容易被接受:

curl -XDELETE -g '10.108.72.213:9200/%25%7b%5b%40metadata%5d%5bbeat%5d%7d-2016.11.18

相关内容