API call - how to set @timestamp (or equivalent)

Im posting some timeseries data from an app. As it stands presently I can't see it in Kibana though I can get it via curl request. The posted data lacks a timestamp so Im wondering what the appropriate syntax is.

Presently using java 1.8 and sending a HashMap via IndexRequest

ES auto detects the field type on initial document insertion.
If you have a string field with one of the common timestamp format, ES will automatically store it as "date", then Kibana will pick it up.
But if you use say epoch, ES will store it as long which will not be recognized by kibana as date.
What you need is to create a template or specify the field you want as timestamp as type "date" when you create the index.
Just look at the mappings documentation. It's pretty straight forward.

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