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

[filebeat] Drop __REALTIME_TIMESTAMP from the output that caused the new field "journald.custom.realtime_timestamp" in the final event document #40658

Merged

Conversation

aleksmaus
Copy link
Member

@aleksmaus aleksmaus commented Aug 29, 2024

Proposed commit message

Drop __REALTIME_TIMESTAMP from the output that caused the new field "journald.custom.realtime_timestamp" in the final event document.

This field was not stored before, thus it is not mapped and causes an issue with the 8.16-SNAPSHOT
elastic/integrations#10757

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

…new field "journald.custom.realtime_timestamp" in the final event document
@aleksmaus aleksmaus added Filebeat Filebeat bugfix Team:Security-Deployment and Devices Deployment and Devices Team in Security Solution labels Aug 29, 2024
@aleksmaus aleksmaus requested review from belimawr, andrewkroh and a team August 29, 2024 15:18
@aleksmaus aleksmaus self-assigned this Aug 29, 2024
@aleksmaus aleksmaus requested a review from a team as a code owner August 29, 2024 15:18
@elasticmachine
Copy link
Collaborator

Pinging @elastic/sec-deployment-and-devices (Team:Security-Deployment and Devices)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Aug 29, 2024
Copy link
Contributor

mergify bot commented Aug 29, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @aleksmaus? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@aleksmaus aleksmaus added release-note:skip The PR should be ignored when processing the changelog backport-skip Skip notification from the automated backport with mergify labels Aug 29, 2024
@@ -85,4 +85,5 @@ var journaldEventFields = FieldConversion{
"_SOURCE_REALTIME_TIMESTAMP": ignoredField, // saved in the registry
Copy link
Member

Choose a reason for hiding this comment

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

Is the comment on L84 inaccurate? It also says it is used for the timestamp.

Copy link
Member Author

@aleksmaus aleksmaus Aug 29, 2024

Choose a reason for hiding this comment

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

It seems like it is not accurate, as far as I understand looking at the current code elastic/integrations#10757 (comment)
@belimawr am I missing some place where it is used?

Copy link
Contributor

Choose a reason for hiding this comment

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

The comment on L84 was there before we started using journalctl to read the journal. Looking at the old code, the timestamp field was coming from the library we used, here is the code that reads the journal and sets the timestamps.

When I re-wrote it to use journalctl, I looked at the code and __REALTIME_TIMESTAMP seemed the best choice to keep the behaviour of the old code/library.

So the comment there might be misleading :/.

I did write a test that compares both implementations reading the same journal file, so I believe the behaviour has not changed with the new implementation.

@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Aug 30, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@aleksmaus aleksmaus merged commit a3db002 into elastic:main Aug 30, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify bugfix Filebeat Filebeat release-note:skip The PR should be ignored when processing the changelog Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team Team:Security-Deployment and Devices Deployment and Devices Team in Security Solution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Stack 8.16.0-SNAPSHOT] [iptables] Failing test daily: system test: journald in iptables.log
5 participants