# How to remove brackets on grok patterns?

**URL:** https://discuss.elastic.co/t/how-to-remove-brackets-on-grok-patterns/310547
**Category:** Logstash
**Tags:** ingest-pipeline
**Created:** [July 25, 2022, 2:33pm UTC](https://discuss.elastic.co/t/how-to-remove-brackets-on-grok-patterns/310547 "2022-07-25T14:33:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![SamuelSMendes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuelsmendes/32/104246_2.png) [@SamuelSMendes](https://discuss.elastic.co/u/SamuelSMendes)
#### Post date: [July 25, 2022, 2:33pm UTC](https://discuss.elastic.co/t/how-to-remove-brackets-on-grok-patterns/310547/1 "2022-07-25T14:33:02Z")

</div>

Continuing the discussion from [Remove characters in grok](https://discuss.elastic.co/t/remove-characters-in-grok/72548/2):

On the previous post is an example of how to remove "," in grok. I was wondering if there is something to remove the "[,]" as well.

I still don't know if is it's coming from my log file structure, but since I am a beginner at the pipelines I got here to see if theres anything already made to deal with it.

Here is problem the brackets are causing:

 ![Captura de Tela (861)](https://us1.discourse-cdn.com/elastic/original/3X/8/a/8a4dec1a32a94ae478b1bfbabba69147909723c2.png)

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [August 12, 2022, 11:34pm UTC](https://discuss.elastic.co/t/how-to-remove-brackets-on-grok-patterns/310547/2 "2022-08-12T23:34:44Z")

</div>

What does your pipeline configuration looks like?

You can use the `mutate` filter to remove the squared brackets.

Something like this:

```auto
 mutate { 
    gsub => ["ID", "[\[\]]", "" ] 
}

```

---

<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: [September 9, 2022, 11:35pm UTC](https://discuss.elastic.co/t/how-to-remove-brackets-on-grok-patterns/310547/3 "2022-09-09T23:35:32Z")

</div>

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