# How to set locale for add\_field inside a date filter?

**URL:** <https://discuss.elastic.co/t/how-to-set-locale-for-add-field-inside-a-date-filter/152559>\
**Category:** Logstash\
**Created:** [October 15, 2018, 9:25pm UTC](https://discuss.elastic.co/t/how-to-set-locale-for-add-field-inside-a-date-filter/152559 "2018-10-15T21:25:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ffknob](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ffknob/32/37008_2.png) [@ffknob](https://discuss.elastic.co/u/ffknob)\
**Post date:** [October 15, 2018, 9:25pm UTC](https://discuss.elastic.co/t/how-to-set-locale-for-add-field-inside-a-date-filter/152559/1 "2018-10-15T21:25:24Z")

</div>

Hi,

I'm trying to create a new field with the weekday based on the @timestamp field, which I generate with a date {} filter. The date {} seems to be working just fine, putting the correct value in the @timestamp. But the thing I'm not figuring out how to do is to generate the "weekday" field in the locale I've specified. The field is being created, but the value is generated using the locale of the host machine (which is in German) and not in Portuguese (my goal).

Is the "locale" parameter only for the "matching" part of the date {}?

Thank you!

Code here ("dia\_semana" == "weekday"):

```
date {
    locale => "pt-BR"
    match => ["data", "dd/MM/yyyy"]
    target => "@timestamp"

    add_field => { "dia_semana" => "%{+EEEEE}" }  
}
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 17, 2018, 8:20pm UTC](https://discuss.elastic.co/t/how-to-set-locale-for-add-field-inside-a-date-filter/152559/2 "2018-10-17T20:20:19Z")

</div>

> Is the "locale" parameter only for the "matching" part of the date {}?

Yes, I think that's safe to assume. The `add_field` functionality is generic for all filters.

---

<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:** [November 14, 2018, 8:20pm UTC](https://discuss.elastic.co/t/how-to-set-locale-for-add-field-inside-a-date-filter/152559/3 "2018-11-14T20:20:20Z")

</div>

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