# Help With Grok Pattern - Mail Log

**URL:** <https://discuss.elastic.co/t/help-with-grok-pattern-mail-log/198888>\
**Category:** Logstash\
**Created:** [September 10, 2019, 11:13am UTC](https://discuss.elastic.co/t/help-with-grok-pattern-mail-log/198888 "2019-09-10T11:13:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerard.ramos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gerard.ramos/32/46958_2.png) [@gerard.ramos](https://discuss.elastic.co/u/gerard.ramos)\
**Post date:** [September 10, 2019, 11:13am UTC](https://discuss.elastic.co/t/help-with-grok-pattern-mail-log/198888/1 "2019-09-10T11:13:41Z")

</div>

Anyone can help with this grok pattern??

```
  grok {
    match => ["message", "^%{DAY:dia} %{DATESTAMP_EVENTLOG:data} %{NOTSPACE:email_addresss}"]
  }

```

Example of the log file:

```
Sat 2019-09-07 08:04:37.283: * From: basededades@grupsa.com
Sat 2019-09-07 00:04:12.245: * From: basededades@grupsa.com
Tue 2019-09-10 00:00:06.687: * From: servicetonic@grupsa.com
Tue 2019-09-10 12:30:28.312: * From: codita2@coditas.org
Mon 2019-09-09 17:00:36.659: * From: base@grupsa.com
Mon 2019-09-09 19:31:47.123: * From: fjmartinez@grupsa.com

```

The log file has other type of lines but I think that will not efect??

---

<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:** [September 10, 2019, 1:29pm UTC](https://discuss.elastic.co/t/help-with-grok-pattern-mail-log/198888/2 "2019-09-10T13:29:05Z")

</div>

You could use

```
grok { match => ["message", "^%{DAY:dia} %{TIMESTAMP_ISO8601:data}: \* From: %{NOTSPACE:email_addresss}"] }

```

However, I would use dissect for that, since it will be cheaper

```
dissect { mapping => { "message" => "%{} %{data} %{+data}: * From: %{email_address}" } }
```

---

<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:** [October 8, 2019, 1:29pm UTC](https://discuss.elastic.co/t/help-with-grok-pattern-mail-log/198888/3 "2019-10-08T13:29:10Z")

</div>

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