Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchors bugfix #94

Merged
merged 3 commits into from
Oct 11, 2016
Merged

Anchors bugfix #94

merged 3 commits into from
Oct 11, 2016

Conversation

wolfgangkarall
Copy link
Contributor

I realized it was not good to place the anchors in the config, because only in the patterns file would they get tested. And right away some tests failed, because they were only working without anchors -> I updated the patterns where necessary, and a single test as well which included the whole syslog line instead of just the message.

…ests.

Also add missing '%' to the end of POSTFIX_SCACHE_LOOKUPS.
- some didn't define the end of the line properly, like POSTFIX_SMTPD_LOSTCONN,
  POSTFIX_SMTPD_PIPELINING, POSTFIX_SMTP_LOSTCONN or POSTFIX_SMTP_TIMEOUT
- some where only lucky to pass the test data because of the missing anchors,
  like POSTFIX_DISCARD or POSTFIX_PS_VIOLATIONS
- remove () around single patterns in aggregated patterns list, which were
  added when moving anchors there but are not necessary
- fix data in test/discard_0001.yaml, we're matching the message only
…tern.

Also use POSTFIX_VIRTUAL pattern in virtual_0001.yaml. Testing for untested
patterns using:

sed -n '/aggregate all patterns/,$s/ .*//p' postfix.grok | tail -n +2 | \
  while read pattern; do
    grep -q "pattern: $pattern$" test/*.yaml \
       || echo $pattern not found
done
@whyscream
Copy link
Owner

I don't like that the anchoring is in the grok file, it makes the patterns less usable/flexible when logging is not easily separated from surrounding cruft like timestamps, or other logging. Putting the anchors in the logstash config file is fine with me, and we can fix the test suite to use anchors too.

@whyscream whyscream merged commit 255bd87 into whyscream:master Oct 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants