# Logstash grok regex bug?

**URL:** <https://discuss.elastic.co/t/logstash-grok-regex-bug/185981>\
**Category:** Logstash\
**Created:** [June 17, 2019, 12:42am UTC](https://discuss.elastic.co/t/logstash-grok-regex-bug/185981 "2019-06-17T00:42:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticnubie](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@elasticnubie](https://discuss.elastic.co/u/elasticnubie)\
**Post date:** [June 17, 2019, 12:42am UTC](https://discuss.elastic.co/t/logstash-grok-regex-bug/185981/1 "2019-06-17T00:42:11Z")

</div>

Logstash grok regex match result is not same with Kibana Grok Debugger.  
(I think Kibana Grok Debugger's result is correct.)

Is there my fault? or is it grok's bug?

**Filebeat Config**

> ```
> filebeat.inputs:
> - type: log
> paths:
> - C:/filebeat/smtp.log
> multiline.pattern: 'SMTP Server: Originator'
> multiline.negate: true
> multiline.match: after
> multiline.flush_pattern: 'SMTP Server: Message'
> 
> ```

**Logstash Config**

> ```
> filter {
> grok {
> match => {
> "message" => "\[.*\] (?<timestamp>\d{4}-\d{2}-\d{2} (?:AM|PM) \d{2}:\d{2}:\d{2}) SMTP Server: Originator: (?<sender>.*?)\n(?<temp_receiver>(?:.*SMTP Server: Recipient: .*\n)+)(?:.*\n)*(?:.*SMTP Server: Message.*size (?<size>.*))"
> }
> }
> }
> 
> ```

**Logstash Debug Output**

 ![output](https://us1.discourse-cdn.com/elastic/original/3X/1/9/195106554e6811c61340e6ac2c077525354621d0.png)

**Kibana Grok Debugger Result**

 ![debugger](https://us1.discourse-cdn.com/elastic/original/3X/6/7/678292032302677202625d66dda6096b5ed21b39.png)

How can I get a same result with kibana grok debugger in logstash grok?  
plz, help me~

---

<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:** [June 17, 2019, 12:56pm UTC](https://discuss.elastic.co/t/logstash-grok-regex-bug/185981/2 "2019-06-17T12:56:17Z")

</div>

Please do not post pictures of text, just post the text.

---

<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:** [July 15, 2019, 12:56pm UTC](https://discuss.elastic.co/t/logstash-grok-regex-bug/185981/3 "2019-07-15T12:56:24Z")

</div>

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