# Logstash Dissect against \\e control character

**URL:** <https://discuss.elastic.co/t/logstash-dissect-against-e-control-character/309993>\
**Category:** Logstash\
**Created:** [July 19, 2022, 8:26am UTC](https://discuss.elastic.co/t/logstash-dissect-against-e-control-character/309993 "2022-07-19T08:26:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Silver137](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Silver137](https://discuss.elastic.co/u/Silver137)\
**Post date:** [July 19, 2022, 8:26am UTC](https://discuss.elastic.co/t/logstash-dissect-against-e-control-character/309993/1 "2022-07-19T08:26:46Z")

</div>

My line to dissect begins with \e[92mContent , I need extract Content avoiding \e[92

I have already try:

```auto
dissect { mapping => { "message" => "\e[92m%{content}"}}

```

But not works

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 19, 2022, 5:22pm UTC](https://discuss.elastic.co/t/logstash-dissect-against-e-control-character/309993/2 "2022-07-19T17:22:00Z")

</div>

Your message does not contain \e. What you have is a CSI (control sequence introductor), which starts with an escape character. rubydebug displays the escape character as \e. A UNIX editor typically displays an escape as ^[.

```
output { stdout { codec => rubydebug { metadata => false } } }
input { generator { count => 1 lines => ['^[[92mFoo'] } }
filter {
    dissect { mapping => { "message" => "^[[92m%{content}"}}
}

```

will produce

```
   "message" => "\e[92mFoo"
   "content" => "Foo"

```

On UNIX you would enter a literal escape by typing ctrl/V and then escape

---

<div class="post-metadata">

**Author:** ![Silver137](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Silver137](https://discuss.elastic.co/u/Silver137)\
**Post date:** [July 20, 2022, 6:01am UTC](https://discuss.elastic.co/t/logstash-dissect-against-e-control-character/309993/3 "2022-07-20T06:01:38Z")

</div>

The king of the forum, related to this things.  
Many thanks.

---

<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:** [August 17, 2022, 6:02am UTC](https://discuss.elastic.co/t/logstash-dissect-against-e-control-character/309993/4 "2022-08-17T06:02:15Z")

</div>

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