Decode SpringBoot ANSI output logging in filebeat

9/8/2021

I have springboot application run as docker in kubernetes and it have 'spring.output.ansi.enabled' set to 'always'. Now I want my filebeat consume the log from the springboot docker logging but the output showing me ANSI character in elasticsearch.

[2m2021-09-08 15:30:00.238[0;39m [32m INFO[0;39m [35m1[0;39m ...

And log file looks something like this

\u001b[2m2021-09-08 15:23:00.213\u001b[0;39m ...

Here is my filebeat configurations:

config:
filebeat.inputs:
- type: container
  encoding: windows1252
  paths:
  - /var/log/containers/*.log

I tried encoding 'windows1252' and 'utf-8' but it doesn't work. How do I get rid of the ANSI character in filebeat?

-- tboom
ansi
docker
filebeat
kubernetes
spring-boot

0 Answers