# Filter a field that has different formats

**URL:** <https://discuss.elastic.co/t/filter-a-field-that-has-different-formats/219232>\
**Category:** Logstash\
**Created:** [February 13, 2020, 2:51pm UTC](https://discuss.elastic.co/t/filter-a-field-that-has-different-formats/219232 "2020-02-13T14:51:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Incauto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/incauto/32/60149_2.png) [@Incauto](https://discuss.elastic.co/u/Incauto)\
**Post date:** [February 13, 2020, 2:51pm UTC](https://discuss.elastic.co/t/filter-a-field-that-has-different-formats/219232/1 "2020-02-13T14:51:51Z")

</div>

Hi, I am currently filtering logs that normaly return this kind of field (among others):

```auto
vfs.fs.size[D:,pused]

```

and my grok for this field is the following:

```auto
vfs.fs.size\[%{DATA:disco},pused\]

```

but for certain machines I got this in the same field:

```auto
vmware.vm.vfs.fs.size[{$URL},{HOST.HOST},/var,pused]

```

and my grok for this is the following:

```auto
vmware.vm.vfs.fs.size\[\{\$URL\}\,\{HOST.HOST\}\,%{DATA:disco},pused\]

```

What would be the best aproach to capture both types of fields?

---

<div class="post-metadata">

**Author:** ![Incauto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/incauto/32/60149_2.png) [@Incauto](https://discuss.elastic.co/u/Incauto)\
**Post date:** [February 13, 2020, 7:32pm UTC](https://discuss.elastic.co/t/filter-a-field-that-has-different-formats/219232/2 "2020-02-13T19:32:45Z")

</div>

Two groks whas the solution, don't know if is it the more elegant but it works

```auto
grok {
                        match => ["message", "%{DATA:some_data}"]
                        match => ["message", "%{DATA:some_data}"]
}
```

---

<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 12, 2020, 7:32pm UTC](https://discuss.elastic.co/t/filter-a-field-that-has-different-formats/219232/3 "2020-03-12T19:32:55Z")

</div>

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