How to turn off the color marking in the log?


There are many color marks in the logs collected from filebeat, which greatly affects the structure of the log. Is there any way to close it? Can I only change the log level from INFO to WARN?

Hi @wajika,

You could use a filebeat processor to remove the ANSI codes from the log entries. The script processor looks like a good option here.
An alternative would be to use an ingest pipeline with the Gsub processor.
For the replacement logic, you can try one of the following regex to find a replace the codes:

Thank you for the solution.
I want to clarify that this log is output by the console. If it is changed to collect the log, this color mark will not appear.