# Two groks?

**URL:** <https://discuss.elastic.co/t/two-groks/213397>\
**Category:** Logstash\
**Created:** [December 31, 2019, 12:16am UTC](https://discuss.elastic.co/t/two-groks/213397 "2019-12-31T00:16:57Z")\
**Posts on this page:** 4\
**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:** [December 31, 2019, 12:16am UTC](https://discuss.elastic.co/t/two-groks/213397/1 "2019-12-31T00:16:57Z")

</div>

I have logs of memory usage, the problem is that some logs description are in spanish and others in english

Logs:

```
  12/30/19 15:34:50 host-name Uso de Memoria % vm.memory.size[pused] 67.6928
  12/30/19 16:03:58 host-name Used Memory % vm.memory.size[pused] 59.1605

```

grok:

```
%{DATA:fecha} %{TIME:hora} %{DATA:hostname} Uso de Memoria % vm.memory.size\[pused] %{NUMBER:porcentaje}

```

I remember reading that is posible to have two groks, but this will trow a grok parse failure, is there another aproach that you can recommend?

---

<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:** [December 31, 2019, 3:30pm UTC](https://discuss.elastic.co/t/two-groks/213397/2 "2019-12-31T15:30:14Z")

</div>

You could use alternation in the pattern

```
%{DATA:fecha} %{TIME:hora} %{DATA:hostname} (Uso de Memoria|Used Memory) % vm.memory.size\[pused] %{NUMBER:porcentaje}
```

---

<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:** [December 31, 2019, 4:39pm UTC](https://discuss.elastic.co/t/two-groks/213397/3 "2019-12-31T16:39:33Z")

</div>

Thanks Brother, you have helped me a lot, have a very good new year!!!!

---

<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:** [January 28, 2020, 4:39pm UTC](https://discuss.elastic.co/t/two-groks/213397/4 "2020-01-28T16:39:33Z")

</div>

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