# Date field to be loaded as @timestamp

**URL:** <https://discuss.elastic.co/t/date-field-to-be-loaded-as-timestamp/59795>\
**Category:** Logstash\
**Created:** [September 5, 2016, 9:59am UTC](https://discuss.elastic.co/t/date-field-to-be-loaded-as-timestamp/59795 "2016-09-05T09:59:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bongo\_zg](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@bongo\_zg](https://discuss.elastic.co/u/bongo_zg)\
**Post date:** [September 5, 2016, 9:59am UTC](https://discuss.elastic.co/t/date-field-to-be-loaded-as-timestamp/59795/1 "2016-09-05T09:59:51Z")

</div>

I would like to load certain data but, when trying to create vertical bar chart with date value on x-axis (date histogram), I am unable to use it.  
The only field I can is @timestamp, and therefore would like to load it with a value from the source file.

I tried using:  
filter {  
mutate {  
replace =\> { "@timestamp@ =\> "%{my\_date}" }  
}  
}

but, I received an error. How could I achieve this?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 5, 2016, 10:02am UTC](https://discuss.elastic.co/t/date-field-to-be-loaded-as-timestamp/59795/2 "2016-09-05T10:02:33Z")

</div>

To parse a date value from the input into the `@timestamp` field, use the [date filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html).

---

<div class="post-metadata">

**Author:** ![bongo\_zg](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@bongo\_zg](https://discuss.elastic.co/u/bongo_zg)\
**Post date:** [September 5, 2016, 10:21am UTC](https://discuss.elastic.co/t/date-field-to-be-loaded-as-timestamp/59795/3 "2016-09-05T10:21:01Z")

</div>

I just tried, but get lot of warnings, and it wasn't loaded.  
What I did wrong?

> filter {  
> date {  
> match =\> ["my\_date", "dd.MM.YYYY HH:mm:ss"]  
> target =\> { "@timestamp" =\> "%{my\_date}" }  
> }  
> }

warning was:

> Failed parsing date from field {:field=\>"my\_date", :value=\>"18.08.2016 12:24:37", :exception=\>"undefined method `start\_with?' for ["@timestamp", "%{my\_date}"]:Array", :config\_parsers=\>"dd.MM.YYYY HH:mm:ss", :config\_locale=\>"default=en\_US", :level=\>:warn}

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 5, 2016, 10:37am UTC](https://discuss.elastic.co/t/date-field-to-be-loaded-as-timestamp/59795/4 "2016-09-05T10:37:02Z")

</div>

Remove the `target` parameter from the date filter block. It is incorrect (should be a string) and defaults to "@timestamp".

---

<div class="post-metadata">

**Author:** ![bongo\_zg](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@bongo\_zg](https://discuss.elastic.co/u/bongo_zg)\
**Post date:** [September 5, 2016, 12:42pm UTC](https://discuss.elastic.co/t/date-field-to-be-loaded-as-timestamp/59795/5 "2016-09-05T12:42:34Z")

</div>

yes, it works now, tnx..

but, I'm not able to choose any field in Kibana (nor @timestamp, nor my\_date) that would show me load graph

---

<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:** [July 6, 2017, 4:39am UTC](https://discuss.elastic.co/t/date-field-to-be-loaded-as-timestamp/59795/6 "2017-07-06T04:39:54Z")

</div>

Closed on July 6, 2017, 4:39am UTC


