Removing ASCII Colour Codes From Log Events in Logstash
During a review of log events coming into Elasticsearch I came across some that included ASCII colour codes in them. Below is one example where they are included in the log level, noting the ‘‘box’’[39mDEBUG’‘box’’[0;39. While this is handy for colouring the log levels while viewing in a terminal, it is not so handy for use in Elasticsearch or Kibana. Some more examples, noting these were mutated to be all uppercase hence the capital ‘‘M’’.