# Logstash - Mutate lowercase doesn't work with filed name

**URL:** <https://discuss.elastic.co/t/logstash-mutate-lowercase-doesnt-work-with-filed-name/234271>\
**Category:** Logstash\
**Created:** [May 26, 2020, 8:10am UTC](https://discuss.elastic.co/t/logstash-mutate-lowercase-doesnt-work-with-filed-name/234271 "2020-05-26T08:10:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stmx38](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stmx38/32/118318_2.png) [@stmx38](https://discuss.elastic.co/u/stmx38)\
**Post date:** [May 26, 2020, 8:10am UTC](https://discuss.elastic.co/t/logstash-mutate-lowercase-doesnt-work-with-filed-name/234271/1 "2020-05-26T08:10:06Z")

</div>

Hello,

I'm trying to unify some of our fields to be the same case. Now we have `TARGET_INDEX` and `target_index`

I have tried to apply mutate lowercase filter as described in the [documentation](https://www.elastic.co/guide/en/logstash/master/plugins-filters-mutate.html#plugins-filters-mutate-lowercase):

```auto
mutate {
    lowercase => ["TARGET_INDEX"]
    # rename => { "TARGET_INDEX" => "target_index" }
    remove_field => ["tags", "@version"]
}

```

On the output and also in the index I see an uppercase field. When I use rename it works as expected - I see it in the output and in the index.

This mutate is the first in the list of filters. Why lowercase may not work?

Logstash version: `logstash 7.0.1`

Thank you!

---

<div class="post-metadata">

**Author:** ![andres-perez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andres-perez/32/136461_2.png) [@andres-perez](https://discuss.elastic.co/u/andres-perez)\
**Post date:** [May 26, 2020, 12:23pm UTC](https://discuss.elastic.co/t/logstash-mutate-lowercase-doesnt-work-with-filed-name/234271/2 "2020-05-26T12:23:45Z")

</div>

Hi,

`lowercase` works with **values** , it won't change field names.  
As you have already tested, rename is the option you need.

---

<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:** [June 23, 2020, 12:23pm UTC](https://discuss.elastic.co/t/logstash-mutate-lowercase-doesnt-work-with-filed-name/234271/3 "2020-06-23T12:23:52Z")

</div>

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