# Help with gsub in mutate heading chars

**URL:** <https://discuss.elastic.co/t/help-with-gsub-in-mutate-heading-chars/151201>\
**Category:** Logstash\
**Created:** [October 5, 2018, 11:27am UTC](https://discuss.elastic.co/t/help-with-gsub-in-mutate-heading-chars/151201 "2018-10-05T11:27:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anabella\_Cristaldi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anabella_cristaldi/32/23612_2.png) [@Anabella\_Cristaldi](https://discuss.elastic.co/u/Anabella_Cristaldi)\
**Post date:** [October 5, 2018, 11:27am UTC](https://discuss.elastic.co/t/help-with-gsub-in-mutate-heading-chars/151201/1 "2018-10-05T11:27:45Z")

</div>

Hi,  
I need to substract the headding 00 in some fields.  
I have tried something like

```
mutate {
            gsub => [
                "from", "[\A00\d+]", "??????"
        ]

}

```

what do I have to put in the ??? in order to have the remaining digits?

Thank you  
Reagrds  
Ana

---

<div class="post-metadata">

**Author:** ![Anabella\_Cristaldi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anabella_cristaldi/32/23612_2.png) [@Anabella\_Cristaldi](https://discuss.elastic.co/u/Anabella_Cristaldi)\
**Post date:** [October 5, 2018, 12:26pm UTC](https://discuss.elastic.co/t/help-with-gsub-in-mutate-heading-chars/151201/2 "2018-10-05T12:26:06Z")

</div>

I think it is solved

```
        gsub => [
                "from", "(\A00)(\d+)", "\2"
        ]

```

Regards

---

<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:** [November 2, 2018, 12:26pm UTC](https://discuss.elastic.co/t/help-with-gsub-in-mutate-heading-chars/151201/3 "2018-11-02T12:26:06Z")

</div>

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