Skip to content
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

Fix access log regex to match input #60

Merged
merged 1 commit into from Apr 10, 2024
Merged

Fix access log regex to match input #60

merged 1 commit into from Apr 10, 2024

Conversation

benharosh
Copy link
Collaborator

Fix a log regex in fluentd config for the artifactory-access.log file, to match a change in the input log

@@ -422,7 +422,7 @@
tag jfrog.rt.artifactory.access
<parse>
@type regexp
expression /^(?<timestamp>[^ ]*) \[(?<trace_id>[^\]]*)\] \[(?<action_response>[^\]]*)\] (?<repo_path>.*) for client : (?<username>.+)/(?<ip>.+)\.$/m
expression /^(?<timestamp>[^\s]*) \[(?<trace_id>[^\]\s]*)\] \[(?<action_response>[^\]\r\n]*)\] (?<repo_path>[^\s]*)? *for client : *(?<username>[^\s]*) *\/ *(?<ip>[^\s]*)?[\.\s]?(\[(?<token>[^\s]*)\])?$/m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker. Just a suggestion for future. In previous job where lots of regexes were used, we had a team rule that any regex must be accompanied by examples of string that the regex tries to match, as well as comprehensive tests. Obviously tests aren't possible here but I think examples here would help future us.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great point. I'll add some examples

@benharosh benharosh merged commit 83f92ca into master Apr 10, 2024
@benharosh benharosh deleted the PTRENG-5967 branch April 10, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants