# Index document with Linux CLI curl and custom document timestamp

**URL:** https://discuss.elastic.co/t/index-document-with-linux-cli-curl-and-custom-document-timestamp/89382
**Category:** Elasticsearch
**Created:** [June 14, 2017, 1:27pm UTC](https://discuss.elastic.co/t/index-document-with-linux-cli-curl-and-custom-document-timestamp/89382 "2017-06-14T13:27:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![domisan](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@domisan](https://discuss.elastic.co/u/domisan)
#### Post date: [June 14, 2017, 1:27pm UTC](https://discuss.elastic.co/t/index-document-with-linux-cli-curl-and-custom-document-timestamp/89382/1 "2017-06-14T13:27:14Z")

</div>

Seems like a silly question but I'm not getting the result I want.

I have millions of documents being indexed in ES coming from Logstash and I'm always depending on the 'default' mappings and I'm happy to see a @timestamp field with the date/time stamp of the indexing time. I also have documents (coming from logs files) where I 'translate' the date/time stamp from the log record into the @timetamp in the final document (done in Logstash).

Now I need to generate documents for storage in ES and I need to use the Linux CLI curl to do this. The documents may be generated with a timestamp different from the current time. I don't find a way to do this in ES 5.x. How do I do something like:

```
curl -H "Content-Type: application/json" -XPOST "host:9200/metrics-${today}/metric/" -d "{
  "metric_name": "queue.depth",
  "metric_value_int": 10,
  "@timestamp": 1497446650
}"

```

Apparently I can't use @timestamp or \_timestamp and using 'timestamp' simply creates a field by that name. Note, the actual timestamp format (in this example epoch seconds) isn't important...

---

<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 12, 2017, 1:27pm UTC](https://discuss.elastic.co/t/index-document-with-linux-cli-curl-and-custom-document-timestamp/89382/2 "2017-07-12T13:27:22Z")

</div>

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