1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-10-17 14:01:01 +00:00

Add code example how to instantiate the ClearColor filter

This commit is contained in:
Holger Just 2017-10-03 22:53:26 +02:00
parent e7fd3677ca
commit 37c85ec038

View File

@ -9,6 +9,12 @@ module Rackstash
module Filters
# Remove all ANSI color codes from the `"message"` field of the given event
# `Hash`.
#
# @example
# Rackstash::Flow.new(STDOUT) do
# # Removes all ANSI color codes from the message field
# filter :clear_color
# end
class ClearColor
# a regular expression matching ANSI color codes
COLOR_REGEX = /\e\[[0-9;]*m/.freeze