# How to delete index? Invalid escape sequence \`%\[f' at index 0 of: %\[fields\]\[log\_type\]-2020.01.09

**URL:** <https://discuss.elastic.co/t/how-to-delete-index-invalid-escape-sequence-f-at-index-0-of-fields-log-type-2020-01-09/214509>\
**Category:** Elasticsearch\
**Created:** [January 9, 2020, 11:37pm UTC](https://discuss.elastic.co/t/how-to-delete-index-invalid-escape-sequence-f-at-index-0-of-fields-log-type-2020-01-09/214509 "2020-01-09T23:37:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehak\_Bhargava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehak_bhargava/32/54750_2.png) [@Mehak\_Bhargava](https://discuss.elastic.co/u/Mehak_Bhargava)\
**Post date:** [January 9, 2020, 11:37pm UTC](https://discuss.elastic.co/t/how-to-delete-index-invalid-escape-sequence-f-at-index-0-of-fields-log-type-2020-01-09/214509/1 "2020-01-09T23:37:43Z")

</div>

I have an index called this in kibana-

```auto
yellow open %[fields][log_type]-2020.01.09

```

and when I try to delete it with this command-

```auto
DELETE /%[fields][log_type]-2020.01.09

```

I get an error which says-

```auto
{
  "error": "invalid escape sequence `%[f' at index 0 of: %[fields][log_type]-2020.01.09, allowed: [GET, PUT, DELETE, HEAD]",
  "status": 405
}

```

Why am I not able to delete the indexes with %sign in front?

---

<div class="post-metadata">

**Author:** ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)\
**Post date:** [January 10, 2020, 11:56am UTC](https://discuss.elastic.co/t/how-to-delete-index-invalid-escape-sequence-f-at-index-0-of-fields-log-type-2020-01-09/214509/2 "2020-01-10T11:56:24Z")

</div>

Hi @Mehak_Bhargava,

[% has a special meaning in URL/URI's](https://en.wikipedia.org/wiki/Percent-encoding) and I think this is why this is failing. It is likely that it succeeds if you do:

DELETE /%25[fields][log\_type]-2020.01.09

I am not sure if this is by design or not. If you want an answer to that I suggest to ask in the [kibana forums](https://discuss.elastic.co/c/kibana).

---

<div class="post-metadata">

**Author:** ![Mehak\_Bhargava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehak_bhargava/32/54750_2.png) [@Mehak\_Bhargava](https://discuss.elastic.co/u/Mehak_Bhargava)\
**Post date:** [January 10, 2020, 7:10pm UTC](https://discuss.elastic.co/t/how-to-delete-index-invalid-escape-sequence-f-at-index-0-of-fields-log-type-2020-01-09/214509/3 "2020-01-10T19:10:31Z")

</div>

This helped! Thanks, @HenningAndersen I think its important to have curly brackets after the '%' sign while creating the index in logstash which was my mistake. So for instance, this-

```auto
index => "%{[fields][log_type]}-%{+YYYY.MM.dd}"

```

---

<div class="post-metadata">

**Author:** ![Mehak\_Bhargava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehak_bhargava/32/54750_2.png) [@Mehak\_Bhargava](https://discuss.elastic.co/u/Mehak_Bhargava)\
**Post date:** [January 25, 2020, 12:21am UTC](https://discuss.elastic.co/t/how-to-delete-index-invalid-escape-sequence-f-at-index-0-of-fields-log-type-2020-01-09/214509/4 "2020-01-25T00:21:08Z")

</div>

@HenningAndersen, Hi again. I have an issue with the solution mentioned above. It worked at that time but now my index is called

```auto
 %{[fields][tag]}

```

and it isnt deleting at all. I added the curly bracket as discussed before but now facing similar issue. Please let me know root cause.

---

<div class="post-metadata">

**Author:** ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)\
**Post date:** [January 26, 2020, 8:02pm UTC](https://discuss.elastic.co/t/how-to-delete-index-invalid-escape-sequence-f-at-index-0-of-fields-log-type-2020-01-09/214509/5 "2020-01-26T20:02:25Z")

</div>

Hi @Mehak_Bhargava,

you should be able to delete the index if you escape the special characters. Something like:

```auto
DELETE /%25%7b%5bfields%5d%5btag%5d%7d

```

You can read more on the percent-encoding in [rfc 3986](https://tools.ietf.org/html/rfc3986#section-2.1).

If you seek help on how to setup logstash correctly, I suggest to address that part of the question to the [logstash forum](https://discuss.elastic.co/c/logstash).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 23, 2020, 8:02pm UTC](https://discuss.elastic.co/t/how-to-delete-index-invalid-escape-sequence-f-at-index-0-of-fields-log-type-2020-01-09/214509/6 "2020-02-23T20:02:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
