Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Parse request method, URL, and protocol separately in web server logs. #1824

Merged
merged 1 commit into from
May 22, 2024

Conversation

aaronweeden
Copy link
Contributor

@aaronweeden aaronweeden commented Feb 21, 2024

Description

This PR updates the web server log parser to split the request line (i.e., %r, e.g., GET /index.html HTTP/1.1) into its three parts (i.e., %m %U %H) so these can be parsed separately.

Motivation and Context

This enables ubccr/xdmod-ondemand#50.

Tests performed

I added unit tests to make sure a log is correctly parsed whether the format is %r or %m %U %H. I also tested ingesting logs on my port on xdmod-dev with the changes from ubccr/xdmod-ondemand#50 and the PRs on which it depends.

Checklist:

  • The pull request description is suitable for a Changelog entry
  • The milestone is set correctly on the pull request
  • The appropriate labels have been added to the pull request

@aaronweeden aaronweeden added enhancement Enhancement of the functionality of an existing feature Open OnDemand Specific changes for Open OnDemand Integration labels Feb 21, 2024
@aaronweeden aaronweeden added this to the 11.0.0 milestone Feb 21, 2024
@aaronweeden aaronweeden force-pushed the log-file-split-request branch 5 times, most recently from 005cda5 to 34da864 Compare May 13, 2024 19:26
@aaronweeden aaronweeden marked this pull request as ready for review May 13, 2024 19:26
@aaronweeden aaronweeden force-pushed the log-file-split-request branch 2 times, most recently from 5686d66 to f76b815 Compare May 15, 2024 13:54
@jpwhite4
Copy link
Member

The webserver log parser already supports requestMethod (%m) and url === requestPath (%U) format strings.

Why don't we use these?

@aaronweeden aaronweeden force-pushed the log-file-split-request branch 4 times, most recently from 355ad7b to 94a483b Compare May 20, 2024 17:30
@aaronweeden aaronweeden changed the title Add properties for request method and path to parsed web server logs. Parse request method, URL, and protocol separately in web server logs. May 20, 2024
@aaronweeden aaronweeden force-pushed the log-file-split-request branch from 94a483b to 642bbe1 Compare May 20, 2024 17:31
@aaronweeden
Copy link
Contributor Author

The webserver log parser already supports requestMethod (%m) and url === requestPath (%U) format strings.

Why don't we use these?

@jpwhite4 Thanks, I have refactored it to use %m, %U, and %H; added unit tests; and updated ubccr/xdmod-ondemand#50.

@aaronweeden aaronweeden force-pushed the log-file-split-request branch from 642bbe1 to de2d2ed Compare May 20, 2024 17:33
@aaronweeden aaronweeden force-pushed the log-file-split-request branch from de2d2ed to edbfc29 Compare May 22, 2024 20:48
@aaronweeden aaronweeden merged commit 397d999 into ubccr:xdmod11.0 May 22, 2024
4 checks passed
@aaronweeden aaronweeden deleted the log-file-split-request branch May 22, 2024 21:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement Enhancement of the functionality of an existing feature Open OnDemand Specific changes for Open OnDemand Integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants