# Transform results in index with missing documents when using the API but works for console

**URL:** https://discuss.elastic.co/t/transform-results-in-index-with-missing-documents-when-using-the-api-but-works-for-console/363044
**Category:** Elastic Search
**Tags:** painless, transforms
**Created:** [July 12, 2024, 3:11pm UTC](https://discuss.elastic.co/t/transform-results-in-index-with-missing-documents-when-using-the-api-but-works-for-console/363044 "2024-07-12T15:11:15Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![Patrick\_Whelan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_whelan/32/135049_2.png) [@Patrick\_Whelan](https://discuss.elastic.co/u/Patrick_Whelan)
#### Post date: [July 15, 2024, 7:26pm UTC](https://discuss.elastic.co/t/transform-results-in-index-with-missing-documents-when-using-the-api-but-works-for-console/363044/9 "2024-07-15T19:26:23Z")

</div>

> [@Phil\_McLachlan](#):
>
> Are there any examples on how to do this?

None that I could find, it should be something like:

1. add a pipeline that sets an `event.ingested` field, similar to [How to add time of ingestion to the document?](https://discuss.elastic.co/t/how-to-add-time-of-ingestion-to-the-document/243042)
2. in the first transform, add the pipeline to the destination: `"dest": { "index": "phils_test_01", "pipeline": "pipeline_add_ingest_timestamp" },`
3. in the second transform, add the `event.ingested` field as the sync field: `"sync": { "time": { "field": "event.ingested", "delay": "60s" } }`

---

_[View the full topic](https://discuss.elastic.co/t/transform-results-in-index-with-missing-documents-when-using-the-api-but-works-for-console/363044)._
