Fix whitelist monitor path and disabled flags - #138
Merged
Conversation
| // glob patterns (containing *, ?, or [) or PCRE regexes (containing (, |, | ||
| // $, or \). The latter are not valid globs and must not be passed to filelog. | ||
| func IsGlobPattern(s string) bool { | ||
| return s != "" && strings.ContainsAny(s, "*?[") && !strings.ContainsAny(s, "(|$\\") |
Collaborator
There was a problem hiding this comment.
this will return true for some regex which can include *, [.
For example, .*log, foo.*bar, and [0-9]+ are valid regular expressions, but this function returns true for them. They are then passed to filelog as globs and no regex filter is added.
Collaborator
Author
There was a problem hiding this comment.
from splunk's documentation looks like whitelist is:
whitelist = <your_custom regex>
so I think we can assume it is always a regex
omrozowicz-splunk
marked this pull request as ready for review
September 10, 2026 12:53
dmitryax
approved these changes
Sep 10, 2026
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.
This PR:
(\.log|log$|messages|secure|auth)). Previously this regex was joined to the monitored path and passed to filelog as a glob, which never matched anything. Now whitelist/blacklist values are always treated as PCRE regexes per Splunk docs and applied as stanza filter operators onlog.file.path.dir/*so filelog can match files inside it.disabled=truenot being recognised:IsDisabled()previously only handleddisabled=1; it now also handlesdisabled=true.ApplyIncludeExcludeandApplyStanzaConfiginto a sharedpkg/splunkta/receiver/filterpackage used by bothmonitorreceiverandbatchreceiver.