Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattheworiordan/fluent-plugin-color-stripper
Fluentd plugin to strip ANSI color codes from input logs
https://github.com/mattheworiordan/fluent-plugin-color-stripper
Last synced: 2 months ago
JSON representation
Fluentd plugin to strip ANSI color codes from input logs
- Host: GitHub
- URL: https://github.com/mattheworiordan/fluent-plugin-color-stripper
- Owner: mattheworiordan
- License: mit
- Created: 2015-02-13T16:50:36.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-03-12T03:15:49.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T15:50:47.913Z (3 months ago)
- Language: Ruby
- Size: 15.6 KB
- Stars: 11
- Watchers: 4
- Forks: 14
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Fluent::Plugin::ColorStripper
An out plugin for [Fluentd](http://fluentd.org) 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
'[0mYou can specify all or specific fields to have the ANSI color stripped
## Installation
$ gem install fluent-plugin-color-stripper
## Usage
@type color_stripper
tag output.tag
strip_fields key1, key2
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.
@type color_stripper
tag output.tag
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"
}