# Timestamp on ES using Mongo River

**URL:** <https://discuss.elastic.co/t/timestamp-on-es-using-mongo-river/17531>\
**Category:** Elasticsearch\
**Created:** [May 15, 2014, 11:11am UTC](https://discuss.elastic.co/t/timestamp-on-es-using-mongo-river/17531 "2014-05-15T11:11:05Z")\
**Posts on this page:** 2\
**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:** [May 15, 2014, 11:11am UTC](https://discuss.elastic.co/t/timestamp-on-es-using-mongo-river/17531/1 "2014-05-15T11:11:05Z")

</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:** ![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/timestamp-on-es-using-mongo-river/17531/2 "2017-07-06T01:29:12Z")

</div>


