# Logstash dateparse error

**URL:** <https://discuss.elastic.co/t/logstash-dateparse-error/342209>\
**Category:** Logstash\
**Created:** [September 4, 2023, 3:00am UTC](https://discuss.elastic.co/t/logstash-dateparse-error/342209 "2023-09-04T03:00:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [September 4, 2023, 3:32am UTC](https://discuss.elastic.co/t/logstash-dateparse-error/342209/2 "2023-09-04T03:32:40Z")

</div>

It does sound like a locale problem. If I run this configuration in an en\_US locale

```
input { generator { count => 1 lines => [''] } }
output { stdout { codec => rubydebug { metadata => false } } }
filter {
    mutate { add_field => { "date1" => "03-Sep-23 15:50:15" } }

    date { match => ["date1", "dd-MMM-yy HH:mm:ss"] target => "dateA" locale => "en_GB.UTF-8" }
    date { match => ["date1", "dd-MMM-yy HH:mm:ss"] target => "dateB" locale => "en_GB" }
    date { match => ["date1", "dd-MMM-yy HH:mm:ss"] target => "dateC" locale => "en_UK" }
    date { match => ["date1", "dd-MMM-yy HH:mm:ss"] target => "dateD" locale => "en" }
}

```

then I get [dateA], [dateC], [dateD], plus a \_dateparsefailure instead of [dateB].

I have no clue how $LANG gets translated into the default locale by the time Ruby calls Java. Using `locale => "$LANG"` might be an option.

---

_[View the full topic](https://discuss.elastic.co/t/logstash-dateparse-error/342209)._
