Skip to content

Commit

Permalink
Merge pull request #178 from Busindre/patch-3
Browse files Browse the repository at this point in the history
Update postfix.grok (skipped, still being delivered)
  • Loading branch information
whyscream authored Oct 11, 2023
2 parents 5d80559 + c950ab7 commit 0652d66
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on: [push]
jobs:
build:
test:
runs-on: ubuntu-latest

steps:
Expand All @@ -9,6 +9,6 @@ jobs:
submodules: true
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.2
- run: gem install jls-grok minitest
- run: ruby test/test.rb
5 changes: 3 additions & 2 deletions postfix.grok
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ POSTFIX_CLEANUP_PREPEND %{POSTFIX_QUEUEID:postfix_queueid}: prepend: %{POSTFIX_C
POSTFIX_CLEANUP_MESSAGEID %{POSTFIX_QUEUEID:postfix_queueid}: message-id=<?%{GREEDYDATA_NO_BRACKET:postfix_message-id}>?

# qmgr patterns
POSTFIX_QMGR_REMOVED %{POSTFIX_QUEUEID:postfix_queueid}: removed
POSTFIX_QMGR_MESSAGE (removed|skipped, still being delivered)
POSTFIX_QMGR_INFO %{POSTFIX_QUEUEID:postfix_queueid}: %{POSTFIX_QMGR_MESSAGE:postfix_message}
POSTFIX_QMGR_ACTIVE %{POSTFIX_QUEUEID:postfix_queueid}: %{POSTFIX_KEYVALUE_DATA:postfix_keyvalue_data} \(queue active\)
POSTFIX_QMGR_EXPIRED %{POSTFIX_QUEUEID:postfix_queueid}: from=<%{DATA:postfix_from}>, status=%{STATUS_WORD:postfix_status}, returned to sender

Expand Down Expand Up @@ -116,7 +117,7 @@ POSTFIX_SCACHE_TIMESTAMP statistics: start interval %{SYSLOGTIMESTAMP:postfix_sc
# aggregate all patterns
POSTFIX_SMTPD %{POSTFIX_SMTPD_CONNECT}|%{POSTFIX_SMTPD_DISCONNECT}|%{POSTFIX_SMTPD_LOSTCONN}|%{POSTFIX_SMTPD_NOQUEUE}|%{POSTFIX_SMTPD_PIPELINING}|%{POSTFIX_TLSCONN}|%{POSTFIX_WARNING}|%{POSTFIX_SMTPD_PROXY}|%{POSTFIX_KEYVALUE}
POSTFIX_CLEANUP %{POSTFIX_CLEANUP_MESSAGEID}|%{POSTFIX_CLEANUP_MILTER}|%{POSTFIX_CLEANUP_PREPEND}|%{POSTFIX_WARNING}|%{POSTFIX_KEYVALUE}
POSTFIX_QMGR %{POSTFIX_QMGR_REMOVED}|%{POSTFIX_QMGR_ACTIVE}|%{POSTFIX_QMGR_EXPIRED}|%{POSTFIX_WARNING}
POSTFIX_QMGR %{POSTFIX_QMGR_INFO}|%{POSTFIX_QMGR_ACTIVE}|%{POSTFIX_QMGR_EXPIRED}|%{POSTFIX_WARNING}
POSTFIX_PIPE %{POSTFIX_PIPE_ANY}
POSTFIX_POSTSCREEN %{POSTFIX_PS_CONNECT}|%{POSTFIX_PS_ACCESS}|%{POSTFIX_PS_NOQUEUE}|%{POSTFIX_PS_TOOBUSY}|%{POSTFIX_PS_CACHE}|%{POSTFIX_PS_DNSBL}|%{POSTFIX_PS_VIOLATIONS}|%{POSTFIX_WARNING}
POSTFIX_DNSBLOG %{POSTFIX_DNSBLOG_LISTING}|%{POSTFIX_WARNING}
Expand Down
1 change: 1 addition & 0 deletions test/qmgr_0001.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ pattern: ^%{POSTFIX_QMGR}$
data: "0F5383D: removed"
results:
postfix_queueid: 0F5383D
postfix_message: removed
5 changes: 5 additions & 0 deletions test/qmgr_0006.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pattern: ^%{POSTFIX_QMGR}$
data: "ED06590130AA1C9D6D862: skipped, still being delivered"
results:
postfix_queueid: ED06590130AA1C9D6D862
postfix_message: skipped, still being delivered
2 changes: 1 addition & 1 deletion test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# It creates test cases from all yaml files in the current
# directory.

class TestGrokPatterns < MiniTest::Test
class TestGrokPatterns < Minitest::Test

@@test_dir = File.dirname(__FILE__)
@@upstream_pattern_dir = @@test_dir + '/logstash-patterns-core/patterns/ecs-v1/'
Expand Down

0 comments on commit 0652d66

Please sign in to comment.