How to enable _timestamp by default for all the documents?


(Vikas Gopal) #1

Hi Esperts,

I want to enable _timestamp for all the documents in ES 1.7.1, I mean when I index the data timestamp should enable with the document.
For now this is what I tried.

POST /clust
{
"mappings" : {
"default":{
"_timestamp" : {
"enabled" : true,
"store" : true
}
}
}
}

Now when I am feeding data to ES and check it in Kibana I do not see timestamp field in the drop down .I can only see document time


(Jimferenczi) #2

The issue is in Kibana. You can try the following steps:
Go to Settings/Advanced.
Edit the metaFields and add "_timestamp". Hit save.

Though please note that _timestamp is deprecated in ES > 2.0:
https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-timestamp-field.html


(Vikas Gopal) #3

Thanks Jim,

Ok with above steps I am able to see _timestamp in kibana Drop Down but after selecting it I got nothing in Discover , any idea why is it so ?

Thanks
VG


(Jimferenczi) #4

Did you reindex your data after you enabled the timestamp ?


(Vikas Gopal) #5

Oh yes I always follow this , so I delete my index and then enable timestamp, then I re index my data .

My data is as follows (I am directly feeding it via ES )

Name,rollno,marks,time
vg,12,50,12321231(EPOCH time)


(Jimferenczi) #6

No idea then. Did you try to use the field in a dashboard ?


(Vikas Gopal) #7

ok, if not timestamp can you please guide how I can show this EPOCH date(1457005581) in date time format . For now this is what I done

PUT /clust
{
"mappings" : {
"default" : {
"_all" : {"enabled" : false},
"properties" : {
"time": {"type": "date"}
}
}
}
}

But again the challenge is I do not see any document in Kibana . It seems ES is not converting my Document epoch to default date and time format.


(Vikas Gopal) #8

I guess I have to open a separate thread for this .


(system) #9