# Logging from script within Ruby Filter

**URL:** https://discuss.elastic.co/t/logging-from-script-within-ruby-filter/328012
**Category:** Logstash
**Created:** [March 19, 2023, 9:10am UTC](https://discuss.elastic.co/t/logging-from-script-within-ruby-filter/328012 "2023-03-19T09:10:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![16318a22907f3cbfa04b](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/16318a22907f3cbfa04b/32/36875_2.png) [@16318a22907f3cbfa04b](https://discuss.elastic.co/u/16318a22907f3cbfa04b)
#### Post date: [March 19, 2023, 9:10am UTC](https://discuss.elastic.co/t/logging-from-script-within-ruby-filter/328012/1 "2023-03-19T09:10:30Z")

</div>

Hello,

I can write to the logfile of Logstash from code within ruby filter. [https://discuss.elastic.co/t/logging-from-within-ruby-filter/127983/2](https://discuss.elastic.co/t/logging-from-within-ruby-filter/127983/2)

Is it possible to do the same from script (not code)?  
And when yes how?

Thanks in advance

---

<div class="post-metadata">

### Author: ![16318a22907f3cbfa04b](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/16318a22907f3cbfa04b/32/36875_2.png) [@16318a22907f3cbfa04b](https://discuss.elastic.co/u/16318a22907f3cbfa04b)
#### Post date: [March 19, 2023, 9:48am UTC](https://discuss.elastic.co/t/logging-from-script-within-ruby-filter/328012/2 "2023-03-19T09:48:42Z")

</div>

I found `@ __logger__ ` in **execution\_context.rb** on source code. No more questions.

---

<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: [April 16, 2023, 9:48am UTC](https://discuss.elastic.co/t/logging-from-script-within-ruby-filter/328012/3 "2023-04-16T09:48:52Z")

</div>

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