# Stop on a specific character

**URL:** <https://discuss.elastic.co/t/stop-on-a-specific-character/174369>\
**Category:** Logstash\
**Created:** [March 28, 2019, 3:01pm UTC](https://discuss.elastic.co/t/stop-on-a-specific-character/174369 "2019-03-28T15:01:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![markov](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@markov](https://discuss.elastic.co/u/markov)\
**Post date:** [March 28, 2019, 3:01pm UTC](https://discuss.elastic.co/t/stop-on-a-specific-character/174369/1 "2019-03-28T15:01:04Z")

</div>

hello guys,  
i have a java log line "BusinessServiceImpl.java:7651)" and i want to stop just at the character ")" how can i do that with grok.

thanks in advance.

---

<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:** [March 28, 2019, 3:25pm UTC](https://discuss.elastic.co/t/stop-on-a-specific-character/174369/2 "2019-03-28T15:25:53Z")

</div>

```
grok { match => { "message" => "^(?<foo>[^\)]+)" } }

```

That is, from the beginning of line, any characters that are not ). That will stop capturing before the ).

---

<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:** [April 25, 2019, 3:25pm UTC](https://discuss.elastic.co/t/stop-on-a-specific-character/174369/3 "2019-04-25T15:25:56Z")

</div>

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