-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 inputv2 integration #19686
Filebeat inputv2 integration #19686
Conversation
Pinging @elastic/integrations-services (Team:Services) |
This change integrates the v2 input API with the existing filebeat architecture. The log input and the v2 architecure both use the statestore as a common storage for read-states between restarts. The integration wraps the input v2 API into a RunnerFactory, such that new inputs are automatically available to config file relading, autodiscovery, and fleet. Note: this PR does not introduce or link any input yet. The full list of changes will include: - Introduce v2 API interfaces - Introduce [compatibility layer](https://github.com/urso/beats/tree/fb-input-v2-combined/filebeat/input/v2/compat) to integrate API with existing functionality - Introduce helpers for writing [stateless](https://github.com/urso/beats/blob/fb-input-v2-combined/filebeat/input/v2/input-stateless/stateless.go) inputs. - Introduce helpers for writing [inputs that store a state](https://github.com/urso/beats/tree/fb-input-v2-combined/filebeat/input/v2/input-cursor) between restarts. - Integrate new API with [existing inputs and modules](https://github.com/urso/beats/blob/fb-input-v2-combined/filebeat/beater/filebeat.go#L301) in filebeat.
21adcab
to
1820e36
Compare
|
||
func init() { | ||
// Filebeat build the beat root command for executing filebeat and it's subcommands. | ||
func Filebeat(inputs beater.PluginFactory) *cmd.BeatsRootCmd { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am on the fence about this change. The code itself is better. I am just a bit disappointed that the consistency over different beats cmd/root.go
files are gone. But I guess I can live with that. :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, don't like it either. This last integration step is kinda ugly TBH. But trying to not use globals and x-pack filebeat relying on globals kinda forced me to do this. Long term I think libbeat/cmd
and the <beats>/cmd
packages will be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY!
(cherry picked from commit bce6dea)
(cherry picked from commit bce6dea)
What does this PR do?
This change integrates the v2 input API with the existing filebeat
architecture. The log input and the v2 architecure both use the
statestore as a common storage for read-states between restarts.
The integration wraps the input v2 API into a RunnerFactory, such that
new inputs are automatically available to config file relading,
autodiscovery, and fleet.
Note: this PR does not introduce or link any input yet.
The full list of changes will include:
Why is it important?
Add support for running v2 inputs in Filebeat and Agent.
Checklist
- [ ] 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 inCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Related issues