# Understanding date format issue

**URL:** <https://discuss.elastic.co/t/understanding-date-format-issue/17261>\
**Category:** Elasticsearch\
**Created:** [April 29, 2014, 1:34pm UTC](https://discuss.elastic.co/t/understanding-date-format-issue/17261 "2014-04-29T13:34:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)\
**Post date:** [April 29, 2014, 1:34pm UTC](https://discuss.elastic.co/t/understanding-date-format-issue/17261/1 "2014-04-29T13:34:41Z")

</div>

Hi,

Here are my version details:

ES 1.0.0, MongoDB 2.4.9, mongo-river 2.0.0(with the driver that is required  
for the river plugin)  
The cluster health is green, I have ES 2 nodes on the same machine to make sure the shards are indexed properly.  
I have a river with mongo which fetches events from the remote mongodb.

**Now i have everything up an running but the only issue is with the "time  
format" which is still in UNIX epoch for:**

1.event\_time  
2.timestamp  
3.app\_event\_time

here is the mapping.

curl -XGET [http://ESserverIP:9200/secana/\_mapping?pretty=true](http://ESserverIP:9200/secana/_mapping?pretty=true)  
{  
"secana" : {  
"mappings" : {  
"messages" : {  
"properties" : {  
"app\_event\_time" : {  
"type" : "long"  
},  
"event\_time" : {  
"type" : "long"  
},  
"frecency" : {  
"type" : "long"  
},  
"hostname\_id" : {  
"type" : "string"  
},  
"message" : {  
"type" : "string"  
},  
"netloc" : {  
"type" : "string"  
},  
"signum\_id" : {  
"type" : "string"  
},  
"source" : {  
"type" : "string"  
},  
"source2" : {  
"type" : "string"  
},  
"title" : {  
"type" : "string"  
},  
"url" : {  
"type" : "string"  
},  
"visit\_count" : {  
"type" : "long"  
}  
}  
}  
}  
}  
}

* * *

Now i am still not able to get the correct date format as mentioned in my mapping.

By default it is picking up " long".

I have tried to update the mapping properties using

PUT /\_river/secana/messages/\_mapping

{"secana":{"mappings":{"messages":{"properties":{"\_timestamp":{"enabled":"true","store":"yes"},"app\_event\_time":{"type":"date","format":"YYYY-MM-dd HH:mm:ss"},"event\_time":{"type":"date","format":"YYYY-MM-dd HH:mm:ss"},"firstName":{"type":"string"},"frecency":{"type":"long"},"hostname\_id":{"type":"string"},"lastName":{"type":"string"},"message":{"type":"string"},"netloc":{"type":"string"},"signum\_id":{"type":"string"},"source":{"type":"string"},"source2":{"type":"string"},"timestamp":{"type":"date","format":"YYYY-MM-dd HH:mm:ss"},"title":{"type":"string"},"url":{"type":"string"},"visit\_count":{"type":"long"}}}}}}

But this is not updated.  
Using the head plugin, I could see that the index metadata is still giving me the incorrect details for date fields.  
1.event\_time  
2.timestamp  
3.app\_event\_time  
So i could sense this might be the issue.  
I have tried several to DELETE the index and \_river many times with the correct mapping and index fields.

{

```
state: open
settings: {
    index: {
        uuid: 6UBnCIgFRt-77OexGcIdnQ
        number_of_replicas: 1
        number_of_shards: 5
        version: {
            created: 1000099
        }
    }
}
mappings: {
    messages: {
        properties: {
            visit_count: {
                type: long
            }
            message: {
                type: string
            }
            title: {
                type: string
            }
            signum_id: {
                type: string
            }
            source: {
                type: string
            }
            app_event_time: {
                type: long
            }
            hostname_id: {
                type: string
            }
            event_time: {
                type: long
            }
            netloc: {
                type: string
            }
            source2: {
                type: string
            }
            frecency: {
                type: long
            }
            url: {
                type: string
            }
        }
    }
}
aliases: []

```

}

---

<div class="post-metadata">

**Author:** ![karnamonkster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karnamonkster/32/67266_2.png) [@karnamonkster](https://discuss.elastic.co/u/karnamonkster)\
**Post date:** [May 13, 2014, 11:47am UTC](https://discuss.elastic.co/t/understanding-date-format-issue/17261/2 "2014-05-13T11:47:53Z")

</div>

Any help here please??

On Tuesday, April 29, 2014 7:04:41 PM UTC+5:30, Karan singh wrote:

> Hi,
> 
> Here are my version details:
> 
> ES 1.0.0, MongoDB 2.4.9, mongo-river 2.0.0(with the driver that is  
> required for the river plugin)
> 
> I have a river with mongo which fetches events from the remote mongodb.  
> Now i have everything up an running but the only issue is with the "time  
> format" which is still in UNIX epoch for:
> 
> 1.event\_time  
> 2.timestamp  
> 3.app\_event\_time
> 
> here is the mapping.
> 
> curl -XGET [http://ESserver.com:9200/secana/messages/\_mapping?pretty=true](http://ESserver.com:9200/secana/messages/_mapping?pretty=true)[http://esserver.com:9200/secana/messages/\_mapping?pretty=true](http://esserver.com:9200/secana/messages/_mapping?pretty=true)
> 
> {  
> "secana" : {  
> "mappings" : {  
> "messages" : {  
> "properties" : {  
> "app\_event\_time" : {  
> "type" : "date",  
> "format" : "YYYY-MM-dd HH:mm:ss"  
> },  
> "event\_time" : {  
> "type" : "date",  
> "format" : "YYYY-MM-dd HH:mm:ss"  
> },  
> "firstName" : {  
> "type" : "string"  
> },  
> "frecency" : {  
> "type" : "long"  
> },  
> "hostname\_id" : {  
> "type" : "string"  
> },  
> "lastName" : {  
> "type" : "string"  
> },  
> "message" : {  
> "type" : "string"  
> },  
> "netloc" : {  
> "type" : "string"  
> },  
> "signum\_id" : {  
> "type" : "string"  
> },  
> "source" : {  
> "type" : "string"  
> },  
> "source2" : {  
> "type" : "string"  
> },  
> "timestamp" : {  
> "type" : "date",  
> "format" : "YYYY-MM-dd HH:mm:ss"  
> },  
> "title" : {  
> "type" : "string"  
> },  
> "url" : {  
> "type" : "string"  
> },  
> "visit\_count" : {  
> "type" : "long"  
> }  
> }  
> }  
> }  
> }  
> }
> 
> * * *
> 
> Now i am still not able to get the correct date format as mentioned in my mapping.
> 
> By default it is picking up " long".
> 
> Please help me with this.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/33403258-4fb2-495a-99ba-cd143f592445%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/33403258-4fb2-495a-99ba-cd143f592445%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:29am UTC](https://discuss.elastic.co/t/understanding-date-format-issue/17261/3 "2017-07-06T01:29:48Z")

</div>


