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

[iptables] Fix failing test daily: system test: journald in iptables.log #10883

Closed
wants to merge 7 commits into from

Conversation

aleksmaus
Copy link
Member

Proposed commit message

[iptables] Fix failing test daily: system test: journald in iptables.log

The latest version of filebeat sends the new field journald.custom.realtime_timestamp that didn't have mapping defined. Adding the mapping resolves the issue.

Example:

          "journald": {
            "custom": {
              "realtime_timestamp": "1642033008518660"
            },
            "host": {
              "boot_id": "c2f79f985830406a9e08241d015eff05"
            }
          },

The "auto-mapping" that was created for the index
Screenshot 2024-08-26 at 9 26 47 AM

I'm not 100% sure if this field should present in the first place, but adding the mapping fixes the test failure.
@andrewkroh @taylor-swanson

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Related issues

@aleksmaus aleksmaus added bug Something isn't working, use only for issues Team:Security-Deployment and Devices Deployment and Devices Security team [elastic/sec-deployment-and-devices] labels Aug 26, 2024
@aleksmaus aleksmaus self-assigned this Aug 26, 2024
@aleksmaus aleksmaus requested a review from a team as a code owner August 26, 2024 13:29
@elasticmachine
Copy link

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

@andrewkroh andrewkroh added bugfix Pull request that fixes a bug issue Integration:iptables Iptables and removed bug Something isn't working, use only for issues labels Aug 26, 2024
@elasticmachine
Copy link

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

How about adding config to drop this field entirely until the input is sorted out?

Like a beat processor is what I was thinking:

- drop_fields:
    ignore_missing: true
    fields:
      - journald.custom.realtime_timestamp

@aleksmaus
Copy link
Member Author

- drop_fields:

We could do that with the processor, but the filebeat would need to be fixed before 8.16 release anyways I think.

As far as I understand this approach would fail if the user upgrades to 8.16 filebeat without updating the package and rolling out the agent policy (that includes this drop_fields processor). So there is a chance that the beat would be still sending that field to Elasticsearch.

@andrewkroh
Copy link
Member

True, neither solution addresses the problem of the user upgrading the agent before upgrading the package. Putting a remove processor into ingest pipeline is good mix of the two.

The reason I prefer field deletion over adding a mapping is because when we no longer need this change and can revert it, then will look less like we are making a breaking change.

@aleksmaus
Copy link
Member Author

The reason I prefer field deletion over adding a mapping is because when we no longer need this change and can revert it, then will look less like we are making a breaking change.

Sounds good. Will add remove processor.

@aleksmaus
Copy link
Member Author

aleksmaus commented Aug 27, 2024

Rolled back the mapping change, added drop_fields processor as agreed

Screenshot 2024-08-27 at 9 27 57 AM

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

Putting a remove processor into ingest pipeline is good mix of the two.

Sounds good. Will add remove processor.

added drop_fields processor as agreed

I think we got our wires crossed 😄 . I meant an ingest node pipeline remove processor (https://www.elastic.co/guide/en/elasticsearch/reference/current/remove-processor.html). This marginally better than drop_fields since it would cover cases like standalone agent where the user might not immediately update their edge configuration agent policy similar to what you mentioned.

e.g.

# packages/iptables/data_stream/log/elasticsearch/ingest_pipeline/default.yml
- remove:  
    description: Temporary fix to remove realtime_timestamp until the journald input is fixed.  
    if: ctx.agent?.version != null && ctx.agent.version.startsWith("8.16")  
    field: journald.custom.realtime_timestamp  
    ignore_missing: true

But given that this is meant to be very temporary, what you have is totally fine with me. I expect we'll have the input updated long before 8.16 is released.

@aleksmaus
Copy link
Member Author

I think we got our wires crossed 😄 . I meant an ingest node pipeline remove processor

ohh, though you mentioned drop_field before. Kk can redo with the pipeline processor.

image

@aleksmaus
Copy link
Member Author

Updated.
So many options.

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @aleksmaus

@aleksmaus
Copy link
Member Author

I guess we would not need this change at all if the fix is upstream (in the filebeat), instead would have to add the mapping for the realtime_timestamp

@aleksmaus
Copy link
Member Author

Closing this PR for the fix upstream (in filebeat)
elastic/beats#40658

@aleksmaus aleksmaus closed this Aug 29, 2024
@aleksmaus aleksmaus deleted the fix/iptables_test_failure branch August 29, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull request that fixes a bug issue Integration:iptables Iptables Team:Security-Deployment and Devices Deployment and Devices Security team [elastic/sec-deployment-and-devices]
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
3 participants