# How to convert a unix\_timestamp field to a new date field

**URL:** https://discuss.elastic.co/t/how-to-convert-a-unix-timestamp-field-to-a-new-date-field/50966
**Category:** Logstash
**Created:** [May 25, 2016, 4:36pm UTC](https://discuss.elastic.co/t/how-to-convert-a-unix-timestamp-field-to-a-new-date-field/50966 "2016-05-25T16:36:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![changxy](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@changxy](https://discuss.elastic.co/u/changxy)
#### Post date: [May 25, 2016, 4:36pm UTC](https://discuss.elastic.co/t/how-to-convert-a-unix-timestamp-field-to-a-new-date-field/50966/1 "2016-05-25T16:36:09Z")

</div>

my json log is :

> {  
> "fileid": 203936363,  
> "timestamp": 1464187170,  
> "pubTime": 1464172574,  
> "reads": 111  
> }

my current filter is:  
filter{  
date {  
match =\> ["timestamp", "UNIX"]  
}  
}

now i wish copy the "pubTime" to new field "pubTime\_new" , look like "May 25th 2016, 18:36:14.000" in kibana, and my timezone is +08:00 "Asia/Shanghai"

hope show results in kibana：

@timestamp May 25th 2016, 22:39:30.000  
pubTime 1464172574  
pubTime\_new May 25th 2016, 18:36:14.000  
reads 111

---

<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: [May 26, 2016, 9:45pm UTC](https://discuss.elastic.co/t/how-to-convert-a-unix-timestamp-field-to-a-new-date-field/50966/2 "2016-05-26T21:45:32Z")

</div>

Per [https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html)

```auto
filter{
date {
match => ["pubTime", "UNIX"]
target => "pubTime_new"
}
}

```

---

<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:56am UTC](https://discuss.elastic.co/t/how-to-convert-a-unix-timestamp-field-to-a-new-date-field/50966/3 "2017-07-06T04:56:00Z")

</div>


