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:
parent
e7fd3677ca
commit
37c85ec038
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user