# Need to fetch only selected data from Grok filter

**URL:** https://discuss.elastic.co/t/need-to-fetch-only-selected-data-from-grok-filter/262972
**Category:** Logstash
**Created:** [February 2, 2021, 12:21pm UTC](https://discuss.elastic.co/t/need-to-fetch-only-selected-data-from-grok-filter/262972 "2021-02-02T12:21:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ankitdevnalkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankitdevnalkar/32/46158_2.png) [@ankitdevnalkar](https://discuss.elastic.co/u/ankitdevnalkar)
#### Post date: [February 2, 2021, 12:21pm UTC](https://discuss.elastic.co/t/need-to-fetch-only-selected-data-from-grok-filter/262972/1 "2021-02-02T12:21:22Z")

</div>

`Sample Log : 2020-12-16T04:43:43Z Bitcoin Core version v0.20.1.0-g7ff64311bee570874c4f0dfa18f518552188df08 (release build)`

I want to get the only `version(v0.20.1.0)` from the above log,

Note : version string is a whole word `v0.20.1.0-g7ff64311bee570874c4f0dfa18f518552188df08` and I required only `v0.20.1.0`.

can anybody help me with what I should write in grok pattern ❓

---

<div class="post-metadata">

### Author: ![tatdat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tatdat/32/113160_2.png) [@tatdat](https://discuss.elastic.co/u/tatdat)
#### Post date: [February 2, 2021, 3:27pm UTC](https://discuss.elastic.co/t/need-to-fetch-only-selected-data-from-grok-filter/262972/2 "2021-02-02T15:27:41Z")

</div>

Use grok filter in logstash

```auto
filter {
      grok {
        match => { "message" =>" .* version %{NOTSPACE:version}-.*" }
      }
}

```

---

<div class="post-metadata">

### Author: ![ankitdevnalkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankitdevnalkar/32/46158_2.png) [@ankitdevnalkar](https://discuss.elastic.co/u/ankitdevnalkar)
#### Post date: [February 2, 2021, 5:43pm UTC](https://discuss.elastic.co/t/need-to-fetch-only-selected-data-from-grok-filter/262972/3 "2021-02-02T17:43:30Z")

</div>

> [@tatdat](#):
>
> `.* version %{NOTSPACE:version}-.*`

@tatdat Thanks a lot 🙂

---

<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: [March 2, 2021, 5:44pm UTC](https://discuss.elastic.co/t/need-to-fetch-only-selected-data-from-grok-filter/262972/4 "2021-03-02T17:44:22Z")

</div>

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