# Grok filter

**URL:** <https://discuss.elastic.co/t/grok-filter/282374>\
**Category:** Logstash\
**Created:** [August 24, 2021, 3:17pm UTC](https://discuss.elastic.co/t/grok-filter/282374 "2021-08-24T15:17:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lexanic](https://avatars.discourse-cdn.com/v4/letter/l/85e7bf/32.png) [@lexanic](https://discuss.elastic.co/u/lexanic)\
**Post date:** [August 24, 2021, 3:17pm UTC](https://discuss.elastic.co/t/grok-filter/282374/1 "2021-08-24T15:17:42Z")

</div>

Не работает grok filter  
grok {  
match =\> {  
"message" =\> [  
"%{POSTFIX\_MSG\_ID:taskid}: client=(?\<client\_hostname\>[^]]+)[%{IP:client\_ip}]",  
"%{POSTFIX\_MSG\_ID:taskid}: message-id=\<(?\<message\_id\>[^\>]+)\>._",  
"%{POSTFIX\_MSG\_ID:taskid}: from=\<(?\<from\_mail\>[^\>]+)\>, size=%{INT:size}, nrcpt=%{INT:nrcpt}._",  
"%{POSTFIX\_MSG\_ID:taskid}: to=\<(?\<to\_mail\>[^\>]+)\>,.\* relay=%{NOTSPACE:relay},.\* status=%{NOTSPACE:status} ((?\<status\_msg\>.+)).\*",  
"%{POSTFIX\_MSG\_ID:taskid}: removed"  
]  
}  
}  
В дебаге выдает no match  
если в дебаге сделать %{POSTFIX\_MSG\_ID:taskid}: removed  
то все находит то что надо

---

<div class="post-metadata">

**Author:** ![AquaX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquax/32/92006_2.png) [@AquaX](https://discuss.elastic.co/u/AquaX)\
**Post date:** [August 24, 2021, 6:16pm UTC](https://discuss.elastic.co/t/grok-filter/282374/2 "2021-08-24T18:16:02Z")

</div>

> [@lexanic](#):
>
> POSTFIX\_MSG\_ID

I don't think that this is a valid built-in grok pattern. If you have an example of the log message then I can help you craft a pattern that will match

---

<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 21, 2021, 6:17pm UTC](https://discuss.elastic.co/t/grok-filter/282374/3 "2021-09-21T18:17:03Z")

</div>

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