# How can i use 'or' in logstash grok filter

**URL:** <https://discuss.elastic.co/t/how-can-i-use-or-in-logstash-grok-filter/145685>\
**Category:** Logstash\
**Created:** [August 23, 2018, 8:58am UTC](https://discuss.elastic.co/t/how-can-i-use-or-in-logstash-grok-filter/145685 "2018-08-23T08:58:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wonki](https://avatars.discourse-cdn.com/v4/letter/w/aeb1de/32.png) [@wonki](https://discuss.elastic.co/u/wonki)\
**Post date:** [August 23, 2018, 8:58am UTC](https://discuss.elastic.co/t/how-can-i-use-or-in-logstash-grok-filter/145685/1 "2018-08-23T08:58:41Z")

</div>

sample my log format: first line -\> 320 634  
second line -\> 236 -  
third line -\> 234 123

if i make grok filter like:  
%{NUMBER:response} %{NUMBER:byte}  
then second line makes error.  
i tried  
%{NUMBER:response} (?:%{NUMBER:byte}|-)  
also, but it failed.

So, how can i fix it?

---

<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:** [September 20, 2018, 8:58am UTC](https://discuss.elastic.co/t/how-can-i-use-or-in-logstash-grok-filter/145685/2 "2018-09-20T08:58:41Z")

</div>

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