# Insert {now-1m/d} failure

**URL:** https://discuss.elastic.co/t/insert-now-1m-d-failure/204160
**Category:** Elasticsearch
**Created:** [October 18, 2019, 3:48am UTC](https://discuss.elastic.co/t/insert-now-1m-d-failure/204160 "2019-10-18T03:48:56Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)
#### Post date: [October 22, 2019, 6:42am UTC](https://discuss.elastic.co/t/insert-now-1m-d-failure/204160/2 "2019-10-22T06:42:59Z")

</div>

Unfortunately, you cannot use the `now` syntax at index time. It is a query-time construct.

What you could do instead is define an [ingest pipeline](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html) that automatically adds a timestamp to your documents. [This post](https://discuss.elastic.co/t/dec-12th-2018-en-elasticsearch-automatically-adding-a-timestamp-to-documents/159314) explains how to do that. Instead of the `set` processor used in that post, you'd use a [`script` processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/script-processor.html) to format the date exactly how you want it.

---

_[View the full topic](https://discuss.elastic.co/t/insert-now-1m-d-failure/204160)._
