0

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?

Til
  • 63
  • 1
  • 7

1 Answers1

3

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
sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
  • Any Tips for tools to convert string to URL-encoded Format? – Til Feb 03 '17 at 08:14
  • @Til I don't know of any command-line utils, but python, perl, and ruby all have one-liners that can do it. Or, look up 'urlencode' sites on the web. – sysadmin1138 Feb 04 '17 at 04:18