Date formatting failing - string

(javi) #1


Im using the python library to insert data in elasticsearch

Im trying to format the date i have in epoch format as datetime field

dt = time.strftime('%y-%m-%d %H:%M:%S', time.localtime(float(d['timestamp'])))
dt = datetime.strptime(dt, '%y-%m-%d %H:%M:%S')
es.index(index='test', doc_type='json', id=i, body=d)

However, when accessing the data in kibana, the field timestamp is still considered as a string

What should i do to be able to convert this field to a format that elasticsearch can understand?

If i check in discover, the format is like this:


Which looks like a proper timestamp field


(system) #2

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