Allow specifying log files in file_reader using glob patterns #44
Open
souryogurt wants to merge 11 commits intovxcontrol:masterfrom
Open
Allow specifying log files in file_reader using glob patterns #44souryogurt wants to merge 11 commits intovxcontrol:masterfrom
souryogurt wants to merge 11 commits intovxcontrol:masterfrom
Conversation
a34e721 to
d3519d2
Compare
added 6 commits
January 20, 2023 01:34
Users of file_reader module want to track log files of applications with enabled rotation. In this case, they do not know the exact name of the files to be tracked, and they would like to specify them using glob patterns. Log files can now be specified using glob patterns. But only files existing during module configuration will be tracked.
The function wasn't attaching directory path to the names of files.
This module tracks files specified using wildcard patterns already. It finds such files during configuration. Nevertheless, to track new files created after the module's configuration, the module must constantly monitor directories and keep looking for files added. For this, the DirectoryWatcher has been created.
The directory watcher approach was too error-prone in the agent's environment. It didn't call the function of stopping watchers, which caused crashes sometimes. Rather than monitoring directory changes reactively, the module scans the directory proactively every second now.
The module periodically scans directories for files matching wildcard patterns specified by the user. The interval between scans is customizable with the "period" parameter.
UI let's you select a file to start reading from the beginning. Unfortunately, the list got broken after wildcards were added. Instead of using the configuration list, the browser part now gets the current watched list directly from the agent during initialization.
d3519d2 to
e8212d5
Compare
NexoMichael
reviewed
Jan 30, 2023
It is better to check the operating system directly from the tests themselves and disable them rather than having large "if" blocks that selects tests to run.
The file_reader was crashing in case the savepoint file used to store the latest position in tracked files was empty.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of the Change
Users of file_reader module want to track log files of applications with enabled rotation. In this case, they do not know the exact name of the files to be tracked, and they would like to specify them using glob patterns.
Log files can now be specified using glob patterns.
Closes #8
Changelog Entry
Added ability to specify log files in file_reader using glob patterns.
Checklist: