# Stop proccesing events/lines after first grok match

**URL:** <https://discuss.elastic.co/t/stop-proccesing-events-lines-after-first-grok-match/214696>\
**Category:** Logstash\
**Created:** [January 11, 2020, 8:45am UTC](https://discuss.elastic.co/t/stop-proccesing-events-lines-after-first-grok-match/214696 "2020-01-11T08:45:48Z")\
**Posts on this page:** 1\
**Showing post:** 8

<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:** [January 12, 2020, 10:56pm UTC](https://discuss.elastic.co/t/stop-proccesing-events-lines-after-first-grok-match/214696/8 "2020-01-12T22:56:00Z")

</div>

In that case use ruby and scan

```
ruby { code => 'event.set("anArray", event.get("message").scan(/someRegexp/))' }

```

then pick whichever member of the array that you want.

---

_[View the full topic](https://discuss.elastic.co/t/stop-proccesing-events-lines-after-first-grok-match/214696)._
