Elasticsearch Delete Index with Special Characters

elasticsearch

Unfortunately i created an Index in Elasticsearch with the name: "%{[@metadata][beat]}-2016.11.17"

Any Idea how to delete it, and not run into Problems with the special Characters?

What i tried – on console:

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
}

on kibana dev tools console:

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
}

any Ideas?

Best Answer

You may find the URL-encoded version of that to be more likely to be accepted:

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