# Using ingestion pipeline to add metadata information to documents

**URL:** https://discuss.elastic.co/t/using-ingestion-pipeline-to-add-metadata-information-to-documents/74907
**Category:** Elasticsearch
**Created:** [February 13, 2017, 4:57pm UTC](https://discuss.elastic.co/t/using-ingestion-pipeline-to-add-metadata-information-to-documents/74907 "2017-02-13T16:57:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nidheeshb](https://avatars.discourse-cdn.com/v4/letter/n/e68b1a/32.png) [@nidheeshb](https://discuss.elastic.co/u/nidheeshb)
#### Post date: [February 13, 2017, 4:57pm UTC](https://discuss.elastic.co/t/using-ingestion-pipeline-to-add-metadata-information-to-documents/74907/1 "2017-02-13T16:57:59Z")

</div>

I am trying to use an Ingestion pipeline to add \_timestamp field to the documents.

While using the ingestion simulate API , the response contains the \_timestamp field that gets added due to the pipeline processor

```
POST _ingest/pipeline/_simulate?verbose
{
  "pipeline": {
    "description": "Adds a timestamp field at the current time",
    "processors": [
      {
        "set": {
          "field": "_timestamp",

          "value": "{{_ingest.timestamp}}"
        }
      }
    ]
  },
  "docs":[
    {
      "_index":"newindex",
      "_type": "document",
      "_id":"1",
      "_source":{
        "example":"data3"
      }
    }
    ]
}

```

But after issuing a write request using the pipeline, the **\_timestamp** field fails to get added to the document source. Changing the field name from \_timestamp to timestamp seems to work though.

---

<div class="post-metadata">

### Author: ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)
#### Post date: [February 13, 2017, 7:59pm UTC](https://discuss.elastic.co/t/using-ingestion-pipeline-to-add-metadata-information-to-documents/74907/2 "2017-02-13T19:59:19Z")

</div>

\_timestamp was removed in 5.x:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking\_50\_mapping\_changes.html#\_literal\_\_timestamp\_literal\_and\_literal\_\_ttl\_literal](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_50_mapping_changes.html#_literal __timestamp_literal_and_literal__ ttl_literal)

Also it appears that \_timestamp is still a reserved name. So this is why it works when you just use timestamp. You can see the error by adding a document with a field name called \_timestamp.

---

<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: [March 13, 2017, 8:00pm UTC](https://discuss.elastic.co/t/using-ingestion-pipeline-to-add-metadata-information-to-documents/74907/3 "2017-03-13T20:00:24Z")

</div>

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