Remove ANSI Colour Trings From Log Files Only
Hi,
Is there a way to drop the ANSI colour strings from log files? In particular, I’ve got JSON logging throwing logs over to ES, but they have the ANSI colour escape sequences.
Ideally I don’t want to lose coloured logs from the console though, and I
can’t “see” a way to do this.
Ast 16 at the moment…
Andrew
4 thoughts on - Remove ANSI Colour Trings From Log Files Only
Have you tried starting asterisk with the “-n” param?
-n Disable console colorization
Well I skipped reading the part where you say “only for log files” 🙁
You can post process the logs with something like sed. See:
https://superuser.com/questions/380772/removing-ansi-color-codes-from-text-stream
—
Yeah; we’re injesting using filebeat and you can do sed style parsing on lines into it using one fo the pipeline parsers; it’ sjust a bit messy config wise when using the stnadard docker containers. But if it’s not a
“simple” answer it sounds like that’s not a bad option.
Andrew