# Mutate lowercase example uses array/list

**URL:** <https://discuss.elastic.co/t/mutate-lowercase-example-uses-array-list/370265>\
**Category:** Logstash\
**Created:** [November 9, 2024, 9:40pm UTC](https://discuss.elastic.co/t/mutate-lowercase-example-uses-array-list/370265 "2024-11-09T21:40:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![holobolo0815](https://avatars.discourse-cdn.com/v4/letter/h/ecc23a/32.png) [@holobolo0815](https://discuss.elastic.co/u/holobolo0815)\
**Post date:** [November 9, 2024, 9:40pm UTC](https://discuss.elastic.co/t/mutate-lowercase-example-uses-array-list/370265/1 "2024-11-09T21:40:33Z")

</div>

Hello,

Concerning

> **[Mutate filter plugin | Logstash Reference \[7.17\] | Elastic](https://www.elastic.co/guide/en/logstash/7.17/plugins-filters-mutate.html#plugins-filters-mutate-lowercase)**

In the example it tells you to use a list as the argument. However that makes a list out of what might just be a string.

In my case what worked as expected is:

```
add_field => {
  "qname_lc" => "%{qname}"
}
lowercase => "qname_lc"

```

Not

```
lowercase => ["qname_lc"]

```

which added brackets that I do not need in the result.

Any idea why there are square brackets in the example?

Thanks.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 9, 2024, 10:23pm UTC](https://discuss.elastic.co/t/mutate-lowercase-example-uses-array-list/370265/2 "2024-11-09T22:23:46Z")

</div>

> [@holobolo0815](#):
>
> Any idea why there are square brackets in the example?

Because the lowercase option takes an array of field names, so that you can lowercase more than one field. If you supply a single field name then logstash will happily convert it to an array for you.

Note that add\_field happens after all the other mutate options, so to add a field and then lowercase it you will need to use separate mutate filters for each operation.
