-
Notifications
You must be signed in to change notification settings - Fork 5k
[Filebeat/Journald] Add support for watching folders #46682
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit implements the use of `--directory` argument when calling `journalctl`, thus allowing it to watch for new files in the folder. This is implemented by calling `os.Stat` on the path and checking if it is a folder, if so, then `--directory` is used instead of `--file`.
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
@belimawr a suggestion, when decompressing the files, pass in the |
AndersonQ
approved these changes
Sep 19, 2025
@Mergifyio backport 8.18 8.19 9.0 9.1 |
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
Sep 19, 2025
This commit implements the use of `--directory` argument when calling `journalctl`, thus allowing it to watch for new files in the folder. This is implemented by calling `os.Stat` on the path and checking if it is a folder, if so, then `--directory` is used instead of `--file`. (cherry picked from commit 8af95b5)
6 tasks
mergify bot
pushed a commit
that referenced
this pull request
Sep 19, 2025
This commit implements the use of `--directory` argument when calling `journalctl`, thus allowing it to watch for new files in the folder. This is implemented by calling `os.Stat` on the path and checking if it is a folder, if so, then `--directory` is used instead of `--file`. (cherry picked from commit 8af95b5)
mergify bot
pushed a commit
that referenced
this pull request
Sep 19, 2025
This commit implements the use of `--directory` argument when calling `journalctl`, thus allowing it to watch for new files in the folder. This is implemented by calling `os.Stat` on the path and checking if it is a folder, if so, then `--directory` is used instead of `--file`. (cherry picked from commit 8af95b5)
This was referenced Sep 19, 2025
mergify bot
pushed a commit
that referenced
this pull request
Sep 19, 2025
This commit implements the use of `--directory` argument when calling `journalctl`, thus allowing it to watch for new files in the folder. This is implemented by calling `os.Stat` on the path and checking if it is a folder, if so, then `--directory` is used instead of `--file`. (cherry picked from commit 8af95b5)
6 tasks
belimawr
added a commit
that referenced
this pull request
Sep 22, 2025
This commit implements the use of `--directory` argument when calling `journalctl`, thus allowing it to watch for new files in the folder. This is implemented by calling `os.Stat` on the path and checking if it is a folder, if so, then `--directory` is used instead of `--file`. (cherry picked from commit 8af95b5) Co-authored-by: Tiago Queiroz <[email protected]>
belimawr
added a commit
that referenced
this pull request
Sep 22, 2025
This commit implements the use of `--directory` argument when calling `journalctl`, thus allowing it to watch for new files in the folder. This is implemented by calling `os.Stat` on the path and checking if it is a folder, if so, then `--directory` is used instead of `--file`. (cherry picked from commit 8af95b5) Co-authored-by: Tiago Queiroz <[email protected]>
belimawr
added a commit
that referenced
this pull request
Sep 22, 2025
…olders (#46717) This commit implements the use of `--directory` argument when calling `journalctl`, thus allowing it to watch for new files in the folder. This is implemented by calling `os.Stat` on the path and checking if it is a folder, if so, then `--directory` is used instead of `--file`. (cherry picked from commit 8af95b5) --------- Co-authored-by: Tiago Queiroz <[email protected]>
belimawr
added a commit
that referenced
this pull request
Sep 22, 2025
…olders (#46718) This commit implements the use of `--directory` argument when calling `journalctl`, thus allowing it to watch for new files in the folder. This is implemented by calling `os.Stat` on the path and checking if it is a folder, if so, then `--directory` is used instead of `--file`. (cherry picked from commit 8af95b5) --------- Co-authored-by: Tiago Queiroz <[email protected]>
Merged
8 tasks
This was referenced Sep 26, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport-active-all
Automated backport with mergify to all the active branches
bugfix
Team:Elastic-Agent-Data-Plane
Label for the Agent Data Plane team
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed commit message
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.## Disruptive User Impact## Author's ChecklistHow to test this PR locally
Testing in Kubernetes to ingest node logs
Start a Kind cluster
Deploy the Elastic Stack, make sure it will be accessible from inside the Kind cluster
I use my own fork of
elastic-package
to bind on all interfaces.Build Filebeat docker image
Load the image into your Kind cluster
Deploy Filebeat reading from
/run/log/journal
Note that the journald configuration points to the folder
/run/log/journal
filebeat-kubernetes.yaml
Ensure the logs are coming in in Kibana
filebeat-9.2.0
Using journal files
Decompress all
journal?.journal.gz
files and prepare the destination folderStart Filebeat with the following configuration
filebeat.yaml
Start monitoring the stats endpoint for published events
You will see a JSON like:
Keep an eye in the
done
counter, that's the number of published events.Move the first journal file to
/tmp/journald
and wait until all events are publishedWait untill the
done
counter is 10.Repeat the process for the other two journal files
There are 10 entries in each file, so at the end of the test, there should be 30 published files.
Related issues
## Use cases## Screenshots## Logs