-
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
Log file collector based on v2 input API #20243
Comments
Pinging @elastic/integrations-services (Team:Services) |
## What does this PR do? This PR adds the skeleton of the new `filestream` input. The name of the input can be changed. The input was renamed from `logfile` because we are not going to provide the same options as the current `log` input. As `logfile` is already used by Agent for the `log` input, it is easier to adopt a new input with a different name. The PR seems big, but the contents of `filebeat/input/filestream/internal/input-logfile` is basically the same as `filebeat/input/v2/input-cursor`. It is separated into a different folder because when the time comes, we would like to unify the two input types. The main difference between the two inputs is that the `configure` function of `input-logfile` returns a `Prospector` which finds inputs dynamically. Whereas `input-cursor` requires a list of paths without globbing. The following files need review: * filebeat/input/filestream/input.go * filebeat/input/filestream/internal/input-logfile/fswatch.go * filebeat/input/filestream/internal/input-logfile/harvester.go * filebeat/input/filestream/internal/input-logfile/input.go * filebeat/input/filestream/internal/input-logfile/prospector.go * filebeat/input/filestream/prospector.go The others are the same as `input-cursor`. Also, updated tests are coming in a new PR. ## Related issues First step #20243
## What does this PR do? This PR adds the skeleton of the new `filestream` input. The name of the input can be changed. The input was renamed from `logfile` because we are not going to provide the same options as the current `log` input. As `logfile` is already used by Agent for the `log` input, it is easier to adopt a new input with a different name. The PR seems big, but the contents of `filebeat/input/filestream/internal/input-logfile` is basically the same as `filebeat/input/v2/input-cursor`. It is separated into a different folder because when the time comes, we would like to unify the two input types. The main difference between the two inputs is that the `configure` function of `input-logfile` returns a `Prospector` which finds inputs dynamically. Whereas `input-cursor` requires a list of paths without globbing. The following files need review: * filebeat/input/filestream/input.go * filebeat/input/filestream/internal/input-logfile/fswatch.go * filebeat/input/filestream/internal/input-logfile/harvester.go * filebeat/input/filestream/internal/input-logfile/input.go * filebeat/input/filestream/internal/input-logfile/prospector.go * filebeat/input/filestream/prospector.go The others are the same as `input-cursor`. Also, updated tests are coming in a new PR. ## Related issues First step elastic#20243 (cherry picked from commit cb624cf)
## What does this PR do? This PR adds the skeleton of the new `filestream` input. The name of the input can be changed. The input was renamed from `logfile` because we are not going to provide the same options as the current `log` input. As `logfile` is already used by Agent for the `log` input, it is easier to adopt a new input with a different name. The PR seems big, but the contents of `filebeat/input/filestream/internal/input-logfile` is basically the same as `filebeat/input/v2/input-cursor`. It is separated into a different folder because when the time comes, we would like to unify the two input types. The main difference between the two inputs is that the `configure` function of `input-logfile` returns a `Prospector` which finds inputs dynamically. Whereas `input-cursor` requires a list of paths without globbing. The following files need review: * filebeat/input/filestream/input.go * filebeat/input/filestream/internal/input-logfile/fswatch.go * filebeat/input/filestream/internal/input-logfile/harvester.go * filebeat/input/filestream/internal/input-logfile/input.go * filebeat/input/filestream/internal/input-logfile/prospector.go * filebeat/input/filestream/prospector.go The others are the same as `input-cursor`. Also, updated tests are coming in a new PR. ## Related issues First step #20243 (cherry picked from commit cb624cf)
## What does this PR do? This PR adds the implementation for `FSWatcher` and `FSScanner` for the `filestream` input. The implementation of `FSScanner` is called `fileScanner`. It is responsible for * resolves recursive globs on creation * normalizes glob patterns on creation * finds files which match the configured paths and returns `FileInfo` for those This is the refactored version of the `log` input's scanner, globber functions. The implementation of `FSWatcher` is called `fileWatcher`. It checks the file list returned by `fileScanner` and creates events based on the result. ## Why is it important? It is required for the `filestream` input. ## Related issues Related #20243
…#21444) ## What does this PR do? This PR adds the implementation for `FSWatcher` and `FSScanner` for the `filestream` input. The implementation of `FSScanner` is called `fileScanner`. It is responsible for * resolves recursive globs on creation * normalizes glob patterns on creation * finds files which match the configured paths and returns `FileInfo` for those This is the refactored version of the `log` input's scanner, globber functions. The implementation of `FSWatcher` is called `fileWatcher`. It checks the file list returned by `fileScanner` and creates events based on the result. ## Why is it important? It is required for the `filestream` input. ## Related issues Related elastic#20243 (cherry picked from commit a119083)
…ner for filestream (#21468) * Add implementation of FSWatcher and FSScanner for filestream (#21444) ## What does this PR do? This PR adds the implementation for `FSWatcher` and `FSScanner` for the `filestream` input. The implementation of `FSScanner` is called `fileScanner`. It is responsible for * resolves recursive globs on creation * normalizes glob patterns on creation * finds files which match the configured paths and returns `FileInfo` for those This is the refactored version of the `log` input's scanner, globber functions. The implementation of `FSWatcher` is called `fileWatcher`. It checks the file list returned by `fileScanner` and creates events based on the result. ## Why is it important? It is required for the `filestream` input. ## Related issues Related #20243 (cherry picked from commit a119083) * Do not run symlink tests on Windows (#21472)
@kvch Could you update this issue with the remaining work for the filestream input? |
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
@kvch as discussed could you please update this issue with the missing parts? |
I am closing this issue. Most of the work is done. The two unfinished task is tracked here separately because they are just enhancements: |
Implement an alternative log file collector (Name: logfile) for use with the agent based on the v2 input API.
The v2 input API allows file state to be stored in a generic key-value store, while requiring the Input type to implement all required logic for state and ACK handling. A generic implementation for stateful inputs is available in the filebeat/input/v2/input-cursor package (currently requires a static set of sources only).
Tasks
Phase 1 (feature-parity)
logfile
Missing features
Phase 2 (enhancements)
filestream
input #23457Inputs based on log
Marking it GA
filestream
input GA Makefilestream
input GA #26127- [ ] remove log input in 8.xRelated: #15324
The text was updated successfully, but these errors were encountered: