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] Add ZooKeeper Module #25128

Merged
merged 10 commits into from
Apr 28, 2021

Conversation

legoguy1000
Copy link
Contributor

@legoguy1000 legoguy1000 commented Apr 18, 2021

What does this PR do?

Adds a new module for ZooKeeper logs.

Why is it important?

Requested by Elastic Cloud team to ingest ZooKeeper logs.

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.

Author's Checklist

How to test this PR locally

cd beats/filebeat
TESTING_FILEBEAT_MODULES=zookeeper mage -v pythonIntegTest

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 18, 2021
@legoguy1000 legoguy1000 force-pushed the 25061-zookeeper-module branch from fed9913 to fb0205c Compare April 18, 2021 04:27
@elasticmachine
Copy link
Collaborator

elasticmachine commented Apr 18, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: jsoriano commented: /test

  • Start Time: 2021-04-28T13:23:29.428+0000

  • Duration: 137 min 56 sec

  • Commit: 1b1807f

Test stats 🧪

Test Results
Failed 0
Passed 13709
Skipped 2285
Total 15994

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 13709
Skipped 2285
Total 15994

@jsoriano jsoriano added the Team:Integrations Label for the Integrations team label Apr 19, 2021
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Apr 19, 2021
@legoguy1000 legoguy1000 force-pushed the 25061-zookeeper-module branch 2 times, most recently from 2acd2d8 to d2e76c4 Compare April 19, 2021 17:18
@legoguy1000
Copy link
Contributor Author

@matschaffer any thoughts on if more should be done for this? If not I'll take the PR out of draft.

@matschaffer
Copy link
Contributor

@legoguy1000 I haven't run it and not sure when I'll be able to to give it a proper review (starting on-call tomorrow).

Just reading it through looks good though so taking out of draft gets 👍 from me.

Maybe @jsoriano can help recommend a reviewer. I'll mention it to some other folks to get eyes on it.

@legoguy1000
Copy link
Contributor Author

Oooh, on-call, been there. Sounds good, I'll take it out of draft. It's an initial release so can always be improved later.

@legoguy1000 legoguy1000 marked this pull request as ready for review April 22, 2021 01:37
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@mergify
Copy link
Contributor

mergify bot commented Apr 22, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b 25061-zookeeper-module upstream/25061-zookeeper-module
git merge upstream/master
git push upstream 25061-zookeeper-module

@legoguy1000 legoguy1000 force-pushed the 25061-zookeeper-module branch from d2e76c4 to e6de063 Compare April 22, 2021 01:38
@jsoriano
Copy link
Member

I will take a look, thanks!

@jsoriano
Copy link
Member

/test

@jsoriano jsoriano self-requested a review April 22, 2021 08:18
@jsoriano jsoriano self-assigned this Apr 22, 2021
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

This is looking great, thanks @legoguy1000 for this!

I have added some suggestions, let me know what you think. Some CI jobs are also complaining about some outdated files, these can be probably solved by running mage update from filebeat and x-pack/filebeat directories and committing the changes.

Other comment I have is that in principle new modules are only added to x-pack/filebeat/module, would you mind to move the module there?

CHANGELOG.next.asciidoc Outdated Show resolved Hide resolved
filebeat/module/zookeeper/_meta/config.yml Outdated Show resolved Hide resolved
filebeat/module/zookeeper/_meta/docs.asciidoc Outdated Show resolved Hide resolved
filebeat/module/zookeeper/audit/manifest.yml Outdated Show resolved Hide resolved
filebeat/module/zookeeper/audit/config/audit.yml Outdated Show resolved Hide resolved
filebeat/module/zookeeper/audit/test/audit.log Outdated Show resolved Hide resolved
filebeat/module/zookeeper/module.yml Outdated Show resolved Hide resolved
filebeat/docs/modules/zookeeper.asciidoc Outdated Show resolved Hide resolved
filebeat/docs/modules/zookeeper.asciidoc Outdated Show resolved Hide resolved
@legoguy1000
Copy link
Contributor Author

This is looking great, thanks @legoguy1000 for this!

I have added some suggestions, let me know what you think. Some CI jobs are also complaining about some outdated files, these can be probably solved by running mage update from filebeat and x-pack/filebeat directories and committing the changes.

Other comment I have is that in principle new modules are only added to x-pack/filebeat/module, would you mind to move the module there?

I can move it. My thought was zookeeper fit alongside Kafka and apache... more than all the security tools but doesn't matter to me.

@legoguy1000
Copy link
Contributor Author

PR updated

@legoguy1000 legoguy1000 force-pushed the 25061-zookeeper-module branch 3 times, most recently from 6ce4965 to 6d45f78 Compare April 22, 2021 18:41
@legoguy1000
Copy link
Contributor Author

@jsoriano I've updated the PR to account for timestamps in the logs and set accordingly. If it looks good to you, can u run the tests?

Copy link
Contributor

@henrikno henrikno left a comment

Choose a reason for hiding this comment

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

This is pretty rad! I haven't tested the audit log but the app log seems to work nicely, especially given how non-parseable the logs are. I like that it also captures event.created an ingested so we can detect delays. Thanks for making this.

- convert:
field: client.address
target_field: client.ip
type: ip
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to future self; this needs 7.13 since it was added recently elastic/elasticsearch#71285

@legoguy1000
Copy link
Contributor Author

This is pretty rad! I haven't tested the audit log but the app log seems to work nicely, especially given how non-parseable the logs are. I like that it also captures event.created an ingested so we can detect delays. Thanks for making this.

Do u have examples of real audit logs? I just used the example logs from the docs and then had to add additional data to match the log pattern.

Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Thanks! I think this is almost ready to go, added some small comments, but nothing serious.

@jsoriano
Copy link
Member

/test

@legoguy1000
Copy link
Contributor Author

@jsoriano I've update the PR with your comments and added your provided sample logs. I think we should be good to test and if it passes merge.

@legoguy1000 legoguy1000 force-pushed the 25061-zookeeper-module branch from 0a35fcd to 00de4e9 Compare April 27, 2021 19:42
@legoguy1000
Copy link
Contributor Author

@jsoriano good to retest.

@jsoriano
Copy link
Member

/test

@legoguy1000
Copy link
Contributor Author

@jsoriano same issue with the @timestamp https://beats-ci.elastic.co/blue/organizations/jenkins/Beats%2Fbeats/detail/PR-25128/20/pipeline/1930#step-2215-log-668. I haven't seen this before. I thought the tests ignore the time fields that change every time.

@legoguy1000
Copy link
Contributor Author

@jsoriano same issue with the @timestamp https://beats-ci.elastic.co/blue/organizations/jenkins/Beats%2Fbeats/detail/PR-25128/20/pipeline/1930#step-2215-log-668. I haven't seen this before. I thought the tests ignore the time fields that change every time.

I know why. its because the 1 set of example logs that doesn't have an timestamp field to parse so the time changes every time. I'm going to get rid of those since u provided logs from the default pattern and it has a timestamp.

@legoguy1000 legoguy1000 force-pushed the 25061-zookeeper-module branch from 084a5ee to 1b1807f Compare April 27, 2021 21:46
@jsoriano
Copy link
Member

Oh, I also thought that tests ignored this field for logs without timestamp, but maybe there are no other cases of that. I am ok in any case with testing only with logs with timestamp as they seem to be the usual default.

@jsoriano
Copy link
Member

/test

@legoguy1000
Copy link
Contributor Author

Oh, I also thought that tests ignored this field for logs without timestamp, but maybe there are no other cases of that. I am ok in any case with testing only with logs with timestamp as they seem to be the usual default.

Ya there's a list in the python script to declare the filesets to ignore because they don't have a timestamp but decided to just remove them for the same reason.

@legoguy1000
Copy link
Contributor Author

@jsoriano finally passed :)

@jsoriano jsoriano merged commit d09dfb0 into elastic:master Apr 28, 2021
jsoriano pushed a commit to jsoriano/beats that referenced this pull request Apr 28, 2021
Adds a new module for ZooKeeper audit and service logs.

(cherry picked from commit d09dfb0)
@jsoriano
Copy link
Member

Merged and backport open, this will be likely released in 7.14.0. Thanks @legoguy1000 for the good work here!

@legoguy1000 legoguy1000 deleted the 25061-zookeeper-module branch April 28, 2021 16:02
jsoriano added a commit that referenced this pull request Apr 29, 2021
Adds a new module for ZooKeeper audit and service logs.

(cherry picked from commit d09dfb0)

Co-authored-by: Alex Resnick <[email protected]>
Co-authored-by: DeDe Morton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Integrations Label for the Integrations team v7.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filebeat module for zookeeper logs
5 participants