Does logstash include some color stripper plug-ins?


Can clean the color character output by docker drive.

At its heart the color stripper is just gsub, so you can use a mutate filter.

Thanks for your reply, I have never used gsub, do you know how to write regular?

such as

"message": "\u001b[40m\u001b[1m\u001b[33mwarn\u001b[39m\u001b[22m\u001b[49m: Elastic.Apm[0]\n {PayloadSenderV2} Failed sending events. Following events were not transferred successfully to the server (http://localhost:8200/):\n Elastic.Apm.Metrics.MetricSet"

remove "\u001b[40m\u001b[1m\u001b[33mwarn\u001b[39m\u001b[22m\u001b[49m:"

I tried it and it didn't work.

In addition, I found that there are many formats for this color character.
How to write a universal rules?

The code I linked to include a regexp that can be applied universally.

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