# Making the Timestamp's type "Date" instead of "String"

**URL:** https://discuss.elastic.co/t/making-the-timestamps-type-date-instead-of-string/181196
**Category:** Elasticsearch
**Created:** [May 15, 2019, 12:47pm UTC](https://discuss.elastic.co/t/making-the-timestamps-type-date-instead-of-string/181196 "2019-05-15T12:47:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![WarriorHarb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warriorharb/32/43201_2.png) [@WarriorHarb](https://discuss.elastic.co/u/WarriorHarb)
#### Post date: [May 15, 2019, 12:47pm UTC](https://discuss.elastic.co/t/making-the-timestamps-type-date-instead-of-string/181196/1 "2019-05-15T12:47:40Z")

</div>

Hello ,  
So i'm stuck with a problem here: I have some log files with an **unstructured** data.  
I parse them using logstash ( **grok filter** ). The problem is **i want to display them in the same order in the log file** (ordered by their own timestamp not the timestamp they were parsed in).  
In order to do this **i need to sort them based on the field "Dates"** (field created using grok to extract the date part ).  
Sorting them requires that **this "Dates" field be of date type and not string type**.  
How can i parse the new log files using Grok filter and have the "Dates" field a date type.  
I have read the documentation about the date in json files and how to reindex , yet they don't seem to make it clearer. here is a sample of the log data:

```
Jan 21 14:00:05.590 OPCM35AVCS207 VCS: [0x00000fd8] Sending CS_CALLACCEPTED for CallID 0x2643c6f14f74035d to: VoIP Connection Server: 861
```

---

<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 12, 2019, 12:47pm UTC](https://discuss.elastic.co/t/making-the-timestamps-type-date-instead-of-string/181196/2 "2019-06-12T12:47:46Z")

</div>

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