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

fix(journald source): Handle missing source timestamp #2387

Merged
merged 2 commits into from Apr 22, 2020

Conversation

bruceg
Copy link
Member

@bruceg bruceg commented Apr 21, 2020

If a source does not give journald a timestamp, the resulting record
will be missing the _SOURCE_REALTIME_TIMESTAMP field that this source
relies on. This patch adds a fallback to __REALTIME_TIMESTAMP if the
above is not available, which is always present.

Closes #2384

Signed-off-by: Bruce Guenter bruce@timber.io

If a source does not give journald a timestamp, the resulting record
will be missing the `_SOURCE_REALTIME_TIMESTAMP` field that this source
relies on. This patch adds a fallback to `__REALTIME_TIMESTAMP` if the
above is not available, which is always present.

Signed-off-by: Bruce Guenter <bruce@timber.io>
@bruceg bruceg added type: bug A code related bug. source: journald Anything `journald` source related labels Apr 21, 2020
@bruceg bruceg requested a review from ktff April 21, 2020 20:15
@bruceg bruceg self-assigned this Apr 21, 2020
Copy link
Contributor

@ktff ktff left a comment

Choose a reason for hiding this comment

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

LGTM, although that or_else would be nice to add.

src/sources/journald.rs Outdated Show resolved Hide resolved
Signed-off-by: Bruce Guenter <bruce@timber.io>
@bruceg bruceg merged commit 76b5e8b into master Apr 22, 2020
@bruceg bruceg deleted the journald-timestamp-fix branch April 22, 2020 21:14
binarylogic pushed a commit that referenced this pull request Apr 24, 2020
* fix(journald source): Handle missing source timestamp

If a source does not give journald a timestamp, the resulting record
will be missing the `_SOURCE_REALTIME_TIMESTAMP` field that this source
relies on. This patch adds a fallback to `__REALTIME_TIMESTAMP` if the
above is not available, which is always present.

Signed-off-by: Bruce Guenter <bruce@timber.io>
binarylogic pushed a commit that referenced this pull request Apr 29, 2020
* fix(journald source): Handle missing source timestamp

If a source does not give journald a timestamp, the resulting record
will be missing the `_SOURCE_REALTIME_TIMESTAMP` field that this source
relies on. This patch adds a fallback to `__REALTIME_TIMESTAMP` if the
above is not available, which is always present.

Signed-off-by: Bruce Guenter <bruce@timber.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source: journald Anything `journald` source related type: bug A code related bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

journald source missing timestamp if journal entry missing _SOURCE_REALTIME_TIMESTAMP
2 participants