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

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

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?

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.

Hi @stephenb. Thank you for your reply.

I used to use the file plugin.

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

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

Take out the codec and see what happens..

And set

write_behavior => "append"

Even though that's supposed to be the default

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