No release in over 3 years
Low commit activity in last 3 years
Output plugin to strip ANSI color codes in the logs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 0.7.5
~> 10

Runtime

~> 0.12
 Project Readme

Fluent::Plugin::ColorStripper

An out plugin for Fluentd to strip ANSI color from log files. No more nasty logs from apps that use color that appear similar to:

[0;33;49mWARN [0m : [0;33;49mRate limit of 6 notifications per hour met for Http monitor 'test' for 'server
'[0m

You can specify all or specific fields to have the ANSI color stripped

Installation

$ gem install fluent-plugin-color-stripper

Usage

<match input.tag>
    @type color_stripper
    tag  output.tag
    strip_fields key1, key2
</match>

Pass this record:

input.tag: {
    "key1": "\033[30mvalue1\033[0m",
    "key2": "\033[31mvalue2\033[0m"
    "key3": "\033[32mvalue3\033[0m"
}

Then you get:

output.tag: {
    "key1": "value1",
    "key2": "value2",
    "key3": "\033[32mvalue3\033[0m"
}

strip_fields

If the field strip_fields is omitted or is empty then all fields will have their color stripped.

<match input.tag>
    @type color_stripper
    tag  output.tag
</match>

Pass this record:

input.tag: {
    "key1": "\033[30mvalue1\033[0m",
    "key2": "\033[31mvalue2\033[0m"
    "key3": "\033[32mvalue3\033[0m"
}

Then you get:

output.tag: {
    "key1": "value1",
    "key2": "value2",
    "key3": "value2"
}