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

Ignore timestamp in redis, haproxy and system filebeat module #9855

Merged
merged 3 commits into from
Jan 2, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion filebeat/tests/system/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def _test_expected_events(self, test_file, objects):

for ev in expected:
found = False
clean_keys(ev)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be needed after #9506 if expected json is regenerated, I have opened #9862 to regenerate the expected json files and remove this line.

for obj in objects:

# Flatten objects for easier comparing
Expand All @@ -204,7 +205,9 @@ def clean_keys(obj):
delete_key(obj, key)

# Remove timestamp for comparison where timestamp is not part of the log line
if obj["event.module"] == "icinga" and obj["event.dataset"] == "startup":
if (obj["event.module"] == "icinga" and obj["event.dataset"] == "startup") or \
(obj["event.module"] in ["redis", "haproxy"] and obj["event.dataset"] == "log") or \
(obj["event.module"] == "system" and obj["event.dataset"] in ["auth", "syslog"]):
delete_key(obj, "@timestamp")


Expand Down