# How to turn off the color marking in the log?

**URL:** <https://discuss.elastic.co/t/how-to-turn-off-the-color-marking-in-the-log/288897>\
**Category:** Logs\
**Created:** [November 10, 2021, 2:40pm UTC](https://discuss.elastic.co/t/how-to-turn-off-the-color-marking-in-the-log/288897 "2021-11-10T14:40:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)\
**Post date:** [November 10, 2021, 2:40pm UTC](https://discuss.elastic.co/t/how-to-turn-off-the-color-marking-in-the-log/288897/1 "2021-11-10T14:40:13Z")

</div>

![微信截图_20211109161600](https://us1.discourse-cdn.com/elastic/original/3X/3/7/372675930fc6fefc0901c5e564cdfa4000467683.png)  
There are many color marks in the logs collected from filebeat, which greatly affects the structure of the log. Is there any way to close it? Can I only change the log level from INFO to WARN?

---

<div class="post-metadata">

**Author:** ![klacabane](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/klacabane/32/97514_2.png) [@klacabane](https://discuss.elastic.co/u/klacabane)\
**Post date:** [November 24, 2021, 3:04pm UTC](https://discuss.elastic.co/t/how-to-turn-off-the-color-marking-in-the-log/288897/2 "2021-11-24T15:04:22Z")

</div>

Hi @wajika,

You could use a filebeat processor to remove the ANSI codes from the log entries. The [script processor](https://www.elastic.co/guide/en/beats/filebeat/current/processor-script.html) looks like a good option here.  
An alternative would be to use an ingest pipeline with the [Gsub processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/gsub-processor.html#gsub-processor).  
For the replacement logic, you can try one of the following regex to find a replace the codes:

- [fluent-plugin-color-stripper/out\_color\_stripper.rb at d0b04940c14a612cb78a8a3a5537e40bb558b9a1 · mattheworiordan/fluent-plugin-color-stripper · GitHub](https://github.com/mattheworiordan/fluent-plugin-color-stripper/blob/d0b04940c14a612cb78a8a3a5537e40bb558b9a1/lib/fluent/plugin/out_color_stripper.rb#L36)
- [python - Filtering out ANSI escape sequences - Stack Overflow](https://stackoverflow.com/questions/13506033/filtering-out-ansi-escape-sequences/33925550#33925550)

---

<div class="post-metadata">

**Author:** ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)\
**Post date:** [November 25, 2021, 1:06am UTC](https://discuss.elastic.co/t/how-to-turn-off-the-color-marking-in-the-log/288897/3 "2021-11-25T01:06:29Z")

</div>

Thank you for the solution.  
I want to clarify that this log is output by the console. If it is changed to collect the log, this color mark will not appear.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 15, 2021, 9:07pm UTC](https://discuss.elastic.co/t/how-to-turn-off-the-color-marking-in-the-log/288897/4 "2021-12-15T21:07:10Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
