# Logstash configuration to defaul current date

**URL:** <https://discuss.elastic.co/t/logstash-configuration-to-defaul-current-date/65297>\
**Category:** Logstash\
**Created:** [November 8, 2016, 5:49am UTC](https://discuss.elastic.co/t/logstash-configuration-to-defaul-current-date/65297 "2016-11-08T05:49:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramesh\_Janagam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramesh_janagam/32/11718_2.png) [@Ramesh\_Janagam](https://discuss.elastic.co/u/Ramesh_Janagam)\
**Post date:** [November 8, 2016, 5:49am UTC](https://discuss.elastic.co/t/logstash-configuration-to-defaul-current-date/65297/1 "2016-11-08T05:49:06Z")

</div>

Hi All,

My application logs have only timestamp information but not date ( hh:mm:ss.SSS). By default logstash is considering the date as 2016-01-01 instead of current date.

```
          "@timestamp" => "2016-01-01T01:40:57.122Z",
           "timestamp" => "10:40:57.122",

```

what is the configuration/plug-in to make the date defaulted to current date? if I want backfill old logs - how to configure this other than hardcoding ?( sorry it might be basic question for but I did not figure out yet);

---

<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:** [November 8, 2016, 6:30am UTC](https://discuss.elastic.co/t/logstash-configuration-to-defaul-current-date/65297/2 "2016-11-08T06:30:59Z")

</div>

There's no way to change this default, but you can use a ruby filter to obtain the current date and prepend that in front of your timestamp, then feed the resulting string to the date filter.

---

<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:** [December 6, 2016, 6:31am UTC](https://discuss.elastic.co/t/logstash-configuration-to-defaul-current-date/65297/3 "2016-12-06T06:31:17Z")

</div>

Closed on December 6, 2016, 6:31am UTC

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