# Logging from painless script in ingest pipeline

**URL:** <https://discuss.elastic.co/t/logging-from-painless-script-in-ingest-pipeline/337716>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [July 5, 2023, 8:44pm UTC](https://discuss.elastic.co/t/logging-from-painless-script-in-ingest-pipeline/337716 "2023-07-05T20:44:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhil\_reddy](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@akhil\_reddy](https://discuss.elastic.co/u/akhil_reddy)\
**Post date:** [July 5, 2023, 8:44pm UTC](https://discuss.elastic.co/t/logging-from-painless-script-in-ingest-pipeline/337716/1 "2023-07-05T20:44:09Z")

</div>

Hi,  
I have a requirement where I am indexing my raw docs to an index (original\_index). I am creating a rollup job for this index which runs every hour. My rollup index goes through an ingest pipeline which has a script.

1. Is there a way I can log some information from the script within ingest pipeline. I tried using ctx.logger.info(). but it is giving me a null pointer exception.
2. If there are any unexpected errors for rolling up the docs, is there any way that I can get alerts (or logs) that something has failed for rollup.
3. If it is possible to log the information, where can I check the logs logged from ingest pipeline/ unexpected failure logs.

Thank you

---

<div class="post-metadata">

**Author:** ![akhil\_reddy](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@akhil\_reddy](https://discuss.elastic.co/u/akhil_reddy)\
**Post date:** [July 6, 2023, 2:00pm UTC](https://discuss.elastic.co/t/logging-from-painless-script-in-ingest-pipeline/337716/2 "2023-07-06T14:00:12Z")

</div>

correcting the question above,  
I am able to see the logs if the rollup job has failed. The log has information about job name and the reason it failed. Is there any way I can log for which document id the rollup job has failed.

---

<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:** [August 3, 2023, 2:00pm UTC](https://discuss.elastic.co/t/logging-from-painless-script-in-ingest-pipeline/337716/3 "2023-08-03T14:00:50Z")

</div>

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