# Ingestion pipeline: setting @timestamp

**URL:** https://discuss.elastic.co/t/ingestion-pipeline-setting-timestamp/384804
**Category:** Elastic Agent
**Created:** [January 29, 2026, 5:30pm UTC](https://discuss.elastic.co/t/ingestion-pipeline-setting-timestamp/384804 "2026-01-29T17:30:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Cristina\_Marletta\_Li](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cristina_marletta_li/32/137793_2.png) [@Cristina\_Marletta\_Li](https://discuss.elastic.co/u/Cristina_Marletta_Li)
#### Post date: [January 29, 2026, 5:30pm UTC](https://discuss.elastic.co/t/ingestion-pipeline-setting-timestamp/384804/1 "2026-01-29T17:30:26Z")

</div>

Hi,

I'd like to set the @timestamp field to the value of event.ingested. It doesn't seem to be possible. My ingestion pipeline:

```auto
{
  "processors": [
    {
      "set": {
        "ignore_empty_value": true,
        "field": "time.original",
        "copy_from": "@timestamp"
      }
    },
    {
      "set": {
        "ignore_empty_value": true,
        "field": "@timestamp",
        "copy_from": "event.ingested"
      }
    }
  ],
  "on_failure": [
    {
      "set": {
        "field": "error.message",
        "value": "Processor {{ _ingest.on_failure_processor_type }} with tag {{ _ingest.on_failure_processor_tag }} in pipeline {{ _ingest.on_failure_pipeline }} failed with message {{ _ingest.on_failure_message }}"
      }
    }
  ]
}

```

In events the value of @timestamp remains unchanged

Thanks for your help!

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [January 29, 2026, 7:07pm UTC](https://discuss.elastic.co/t/ingestion-pipeline-setting-timestamp/384804/2 "2026-01-29T19:07:02Z")

</div>

Hello,

Where are you using this? On a custom pipeline for some Elastic Agent integration?

---

<div class="post-metadata">

### Author: ![Keith\_Massey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/keith_massey/32/83666_2.png) [@Keith\_Massey](https://discuss.elastic.co/u/Keith_Massey)
#### Post date: [January 30, 2026, 2:48pm UTC](https://discuss.elastic.co/t/ingestion-pipeline-setting-timestamp/384804/3 "2026-01-30T14:48:45Z")

</div>

Can you give the steps to reproduce the problem? I just tried that pipeline using this:

```auto
PUT test/_doc/1?pipeline=test-pipeline
{
    "event": {"ingested": 1234},
    "@timestamp": 5679
}

```

I get the expected result:

```auto
{
  "_index": "test",
  "_id": "1",
  "_version": 17,
  "_seq_no": 17,
  "_primary_term": 1,
  "found": true,
  "_source": {
    "@timestamp": 1234,
    "time": {
      "original": 5679
    },
    "event": {
      "ingested": 1234
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [January 30, 2026, 4:30pm UTC](https://discuss.elastic.co/t/ingestion-pipeline-setting-timestamp/384804/4 "2026-01-30T16:30:20Z")

</div>

The main issue here is that if the OP is using a custom pipeline from any Elastic Agent integration, the `event.ingested` will not exist at the time the custom ingest pipeline is executed.

The `event.ingested` field is created by the `.fleet_final_pipeline-1` ingest pipeline, which is set as the `index.final_pipeline` for all Elastic Agent integrations, so this will be only executed after all other pipelines.

All customizations when using Elastic Agent integrations will happen before the field is created, so the user cannot set the `@timestamp` to the value of `event.ingested`.

I think the close it can get is to use the value of `_ingest.metadata`, it will not be the same but probably very close, here is the [example from the documentation](https://www.elastic.co/docs/manage-data/ingest/transform-enrich/ingest-pipelines#access-ingest-metadata).
