# Using script processor in elastic-agent integration

**URL:** https://discuss.elastic.co/t/using-script-processor-in-elastic-agent-integration/342632
**Category:** Elasticsearch
**Created:** [September 8, 2023, 4:36pm UTC](https://discuss.elastic.co/t/using-script-processor-in-elastic-agent-integration/342632 "2023-09-08T16:36:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![aaszxc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaszxc/32/114633_2.png) [@aaszxc](https://discuss.elastic.co/u/aaszxc)
#### Post date: [September 8, 2023, 4:36pm UTC](https://discuss.elastic.co/t/using-script-processor-in-elastic-agent-integration/342632/1 "2023-09-08T16:36:57Z")

</div>

Need your help. I don't like that using kubernetes integration in elastic-agents we have one event\_dataset for all logs: kubernetes.container\_logs

I would like to split it into several. In filebeat this can be done with a script, but how to put this script into elastic-agent integration via kibana?

 ![chrome_LoKQF8Q3vf](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bbe7ce1afac1c413dbaa372d19995e60b73c3f8e.png)

There is documentation, I have studied it, but something is not working. Maybe someone has encountered it and can advise?

> **[Script Processor | Filebeat Reference \[8.9\] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/processor-script.html)**

---

<div class="post-metadata">

### Author: ![krej](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@krej](https://discuss.elastic.co/u/krej)
#### Post date: [October 3, 2023, 3:44pm UTC](https://discuss.elastic.co/t/using-script-processor-in-elastic-agent-integration/342632/2 "2023-10-03T15:44:52Z")

</div>

I can at chime in and say that I've spent half a day trying to run the script processor in elastic-agent/Custom-log integration. What a mess.

Finally I was successful when defining the script on a single line in single quotes, instead of using the \> yaml operator.

---

<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: [October 31, 2023, 3:45pm UTC](https://discuss.elastic.co/t/using-script-processor-in-elastic-agent-integration/342632/3 "2023-10-31T15:45:36Z")

</div>

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