# Lowercase Field Name

**URL:** <https://discuss.elastic.co/t/lowercase-field-name/219987>\
**Category:** Logstash\
**Created:** [February 19, 2020, 2:40pm UTC](https://discuss.elastic.co/t/lowercase-field-name/219987 "2020-02-19T14:40:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![akeslo](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@akeslo](https://discuss.elastic.co/u/akeslo)\
**Post date:** [February 19, 2020, 2:40pm UTC](https://discuss.elastic.co/t/lowercase-field-name/219987/1 "2020-02-19T14:40:46Z")

</div>

Hi All,

How do I rename a field name so that it is in all lowercase? The field name is utilizing a value from another field (cs2Label is uppercase and I'd like to convert it to lowercase before I rename the field):

```
mutate {
    rename => { "cs2" => "new_field_%{cs2Label}" }
}
```

---

<div class="post-metadata">

**Author:** ![ITIC](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@ITIC](https://discuss.elastic.co/u/ITIC)\
**Post date:** [February 20, 2020, 6:57am UTC](https://discuss.elastic.co/t/lowercase-field-name/219987/2 "2020-02-20T06:57:43Z")

</div>

Hi

If I understand correctly, you are using the contents of your field `cs2Label`, which are uppercase, to rename a field called `cs2`, and you want the new name to be lowercase.

You could have a `mutate{}`filter do the lowercase, before your `mutate{ rename ...}`. Check this out: [https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-lowercase](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-lowercase)

If you need to keep to content of your `cs2Label` uppercase, simply copy it over to another field, lowercase this new field and use it as suggested above. Then you can remove all superfluous fields.

Hope this helps.

---

<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:** [March 19, 2020, 6:57am UTC](https://discuss.elastic.co/t/lowercase-field-name/219987/3 "2020-03-19T06:57:55Z")

</div>

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