Graylog2 / Graylog2/graylog2-server

New pipeline function: decolorize

Open
#16,064 1 comment 1 reaction 0 assignees View on GitHub
feature triaged
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

## What?

Add a new pipeline function that can "decolorize" (strip ANSI color codes from the log line, thus making it easier to parse logs further.) log messages.

## Why?

Color codes are VERY useful for logging output when viewing in a terminal, either in realtime, via tail, or via cat. Some applications may also include these codes in their logging and not provide a way to send raw (decolorized) logs. Working with these codes can be cumbersome and difficult.

Having this as a built in pipeline function would greatly simplify this process.

By no means an exhaustive test but i created a naive pipeline rule that does something similar using this regex:

`\[\d+;\d+;\d+m`

## Your Environment

* Graylog Version: 5.1.3
* OpenSearch Version: 2.8.0
* MongoDB Version: 6.0.8
* Operating System: Ubuntu Server 22.04 LTS
* Browser version: Google Chrome Version 115.0.5790.114 (Official Build) (arm64)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.