Menu
This is documentation for the next version of Loki. For the latest stable release, go to the latest version.
Open source
decolorize
The decolorize
stage is a transform stage that lets you strip
ANSI color codes from the log line, thus making it easier to
parse logs further.
There are examples below to help explain.
Decolorize stage schema
yaml
decolorize:
# Currently this stage has no configurable options
Examples
The following is an example showing the use of the decolorize
stage.
Given the pipeline:
yaml
- decolorize:
Would turn each line having a color code into a non-colored one, e.g.
[2022-11-04 22:17:57.811] \033[0;32http\033[0m: GET /_health (0 ms) 204
is turned into
[2022-11-04 22:17:57.811] http: GET /_health (0 ms) 204
Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:

Getting started with logging and Grafana Loki
See a demo of the updated features in Loki, and how to create metrics from logs and alert on your logs with powerful Prometheus-style alerting rules.

Essential Grafana Loki configuration settings
This webinar focuses on Grafana Loki configuration including agents Promtail and Docker; the Loki server; and Loki storage for popular backends.

Scaling and securing your logs with Grafana Loki
This webinar covers the challenges of scaling and securing logs, and how Grafana Enterprise Logs powered by Grafana Loki can help, cost-effectively.