# How convert timestamp in date

**URL:** <https://discuss.elastic.co/t/how-convert-timestamp-in-date/133383>\
**Category:** Logstash\
**Created:** [May 26, 2018, 8:56am UTC](https://discuss.elastic.co/t/how-convert-timestamp-in-date/133383 "2018-05-26T08:56:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![itsgood2bebad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itsgood2bebad/32/31636_2.png) [@itsgood2bebad](https://discuss.elastic.co/u/itsgood2bebad)\
**Post date:** [May 26, 2018, 8:56am UTC](https://discuss.elastic.co/t/how-convert-timestamp-in-date/133383/1 "2018-05-26T08:56:05Z")

</div>

Hello,Im new user for logstash and i need help .  
i want use 'timestamp' column in my csv but its not work .  
If you can help me .  
Thanks

input {  
file{  
path =\>"/Users/itsgood/Desktop/money/coins\_btc.csv"  
start\_position =\>beginning  
sincedb\_path=\>"dev/null"  
}  
file{  
path =\>"/Users/itsgood/Desktop/money/coins\_etc.csv"  
start\_position =\>beginning  
sincedb\_path=\>"dev/null"  
}  
}  
filter{  
csv{  
separator =\> ";"  
columns =\>  
["price\_btc","volume\_24h\_btc","market\_cap\_btc","percent\_change\_1h\_btc","percent\_change\_24h\_btc","percent\_change\_7d\_btc","timestamp\_btc","price\_eth","volume\_24h\_eth","market\_cap\_eth","percent\_change\_1h\_eth",  
"percent\_change\_24h\_eth","percent\_change\_7d\_eth",  
timestamp\_eth"]  
}  
date {  
match =\> ["timestamp","MMM-dd-yyyy HH:mm:ss"]  
target =\> "timestamp\_btc"  
}

}  
output {  
stdout { codec =\> rubydebug }  
elasticsearch {  
hosts =\> ["127.0.0.1:9200"]  
index =\> "csv\_index"  
}  
}

---

<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:** [May 27, 2018, 12:50pm UTC](https://discuss.elastic.co/t/how-convert-timestamp-in-date/133383/2 "2018-05-27T12:50:43Z")

</div>

> match =\> ["timestamp","MMM-dd-yyyy HH:mm:ss"]

This tells the date filter to parse the `timestamp` field. AFAICT you don't have a field by that name. Did you mean `timestamp_btc`?

---

<div class="post-metadata">

**Author:** ![itsgood2bebad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itsgood2bebad/32/31636_2.png) [@itsgood2bebad](https://discuss.elastic.co/u/itsgood2bebad)\
**Post date:** [May 27, 2018, 3:08pm UTC](https://discuss.elastic.co/t/how-convert-timestamp-in-date/133383/3 "2018-05-27T15:08:19Z")

</div>

I test that but ,its not work .  
My timestamp = 1527433633

---

<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:** [May 27, 2018, 3:11pm UTC](https://discuss.elastic.co/t/how-convert-timestamp-in-date/133383/4 "2018-05-27T15:11:06Z")

</div>

Okay, but that's not a timestamp in MMM-dd-yyyy HH:mm:ss format. Try UNIX instead.

---

<div class="post-metadata">

**Author:** ![itsgood2bebad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itsgood2bebad/32/31636_2.png) [@itsgood2bebad](https://discuss.elastic.co/u/itsgood2bebad)\
**Post date:** [May 27, 2018, 3:56pm UTC](https://discuss.elastic.co/t/how-convert-timestamp-in-date/133383/5 "2018-05-27T15:56:43Z")

</div>

Its good now,thanks you very much .you save me

---

<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:** [June 24, 2018, 3:59pm UTC](https://discuss.elastic.co/t/how-convert-timestamp-in-date/133383/6 "2018-06-24T15:59:43Z")

</div>

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