-
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
x-pack/filebeat : Sanitize trace log filename to support multiple OS #35143
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
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.
nits
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.
Given that pretty much every operating system imposes some limits on file name length, I think it would be a good idea to impose some sort guard against really long IDs.
The id
can be set to any value by a user and for stateful inputs Filebeat appends the URL. So this ID value could get really long. Perhaps we impose and document some arbitrary limit like *
will include the first 64 characters of the input id
.
…35143) (#35144) * Sanitize trace log filename for multiple OS * Fix PR comments (cherry picked from commit b47e4fd) Co-authored-by: Bharat Pasupula <[email protected]>
I had some discussion with Dan about this. May be we can take this in a separate issue to see what would be a nicer way to do this |
Sure. #35157 |
…35143) * Sanitize trace log filename for multiple OS * Fix PR comments
What does this PR do?
This PR sanitizes the
request.tracer.filename
in filebeat config to replace:
and/
characters with_
character.Why is it important?
There is a problem with different path separators between HFS+ (colon, ':') and UFS (slash, '/'). This also means that HFS+ file names may contain the slash character and not colons, while the opposite is true for UFS file names.
ReferenceSo the file structure seems to be corrupted in MacOS if the filename has
:
and the same happens in Unix based systems if the filename has/
. Hence replacing them with_
.Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.