# How to print input data to logstash-plain.log file?

**URL:** <https://discuss.elastic.co/t/how-to-print-input-data-to-logstash-plain-log-file/314466>\
**Category:** Logstash\
**Created:** [September 15, 2022, 2:14am UTC](https://discuss.elastic.co/t/how-to-print-input-data-to-logstash-plain-log-file/314466 "2022-09-15T02:14:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![WonhyeongCho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wonhyeongcho/32/119884_2.png) [@WonhyeongCho](https://discuss.elastic.co/u/WonhyeongCho)\
**Post date:** [September 15, 2022, 2:14am UTC](https://discuss.elastic.co/t/how-to-print-input-data-to-logstash-plain-log-file/314466/1 "2022-09-15T02:14:32Z")

</div>

Hello. I'm using logstash for log collection.

I want to write data coming into logstash to a log file.  
I tried many plugins to write data to log file but it didn't work.  
And I edit log4j2 settings like

```auto
logger.logstash_stdout.name = logstash.outputs.stdout
logger.logstash_stdout.level = info
logger.logstash_stdout.appenderRef.rolling.ref = plain_rolling

```

but it didn't work too.

Is there any other way?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 15, 2022, 2:25am UTC](https://discuss.elastic.co/t/how-to-print-input-data-to-logstash-plain-log-file/314466/2 "2022-09-15T02:25:59Z")

</div>

Hi @WonhyeongCho Welcome to the community...

I think you need this... what you are trying to set is just for the logs that are internally generated by logstash not the events that you are collecting through a pipeline.

> **[File output plugin | Logstash Reference \[8.4\] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-file.html)**

---

<div class="post-metadata">

**Author:** ![WonhyeongCho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wonhyeongcho/32/119884_2.png) [@WonhyeongCho](https://discuss.elastic.co/u/WonhyeongCho)\
**Post date:** [September 15, 2022, 4:29am UTC](https://discuss.elastic.co/t/how-to-print-input-data-to-logstash-plain-log-file/314466/3 "2022-09-15T04:29:28Z")

</div>

Hi @stephenb. Thank you for your reply.

I used to use the file plugin.

```auto
file { 
   path => "${sys:_logs}/logstash-plain.log" 
   codec => rubydebug
}

```

It was work. However I worry about the performance degradation.  
The pipeline opens and closes the system log file whenever data comes in and writes the behavior to pipeline log.

pipeline\_mypipeline.log

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/0/c0c28bb44afed3d8e04ce50a98114d10b2c40c0d.png)

Is there any performance issue if there's a lot of data coming in?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 15, 2022, 4:37am UTC](https://discuss.elastic.co/t/how-to-print-input-data-to-logstash-plain-log-file/314466/4 "2022-09-15T04:37:49Z")

</div>

> [@WonhyeongCho](#):
>
> `codec => rubydebug`

Take out the codec and see what happens..

And set

`write_behavior => "append"`

Even though that's supposed to be the default

---

<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 13, 2022, 4:38am UTC](https://discuss.elastic.co/t/how-to-print-input-data-to-logstash-plain-log-file/314466/5 "2022-10-13T04:38:01Z")

</div>

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