# Logstash JDBC input : assigning timestamp column

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-input-assigning-timestamp-column/34677>\
**Category:** Logstash\
**Created:** [November 16, 2015, 1:18pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-assigning-timestamp-column/34677 "2015-11-16T13:18:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chandan\_PR](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@Chandan\_PR](https://discuss.elastic.co/u/Chandan_PR)\
**Post date:** [November 16, 2015, 1:18pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-assigning-timestamp-column/34677/1 "2015-11-16T13:18:50Z")

</div>

Hi,

Using logstash-input-jdbc and logstash-output-elasticsearch plugins I am populating the data from mysql database to elastic search.

In the select query I have a column, which is of data type "datetime".

When the data is populated into elastic search I see the data type as string instead of timestamp.

I did go through the documentation, but couldn't find information about how to set the timestamp column. (If I remember correctly, with the jdbc river this data was populated as timestamp.)

For e.g. a configuration like below:  
jdbcTimeField =\> 'TimeStamp' # The column in your result table that contains a timestamp

is there any alternative approach/configuration which I can use?

Regards,  
Chandan

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 17, 2015, 9:10am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-assigning-timestamp-column/34677/2 "2015-11-17T09:10:59Z")

</div>

You need to create a specific mapping for the field in ES, take a look at [https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping-intro.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping-intro.html)

---

<div class="post-metadata">

**Author:** ![Chandan\_PR](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@Chandan\_PR](https://discuss.elastic.co/u/Chandan_PR)\
**Post date:** [November 30, 2015, 11:57am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-assigning-timestamp-column/34677/3 "2015-11-30T11:57:21Z")

</div>

Thanks for the reply Mark.

With a date filter, I am able to do the needful.

---

<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, 5:20am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-assigning-timestamp-column/34677/4 "2017-07-06T05:20:49Z")

</div>


