Skip to content

Commit

Permalink
Allow @ in remote user format string when parsing web server log fi…
Browse files Browse the repository at this point in the history
…les.
  • Loading branch information
aaronweeden committed Feb 8, 2024
1 parent 932ace1 commit 3bff18e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions classes/ETL/DataEndpoint/WebServerLogFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public function __construct(DataEndpointOptions $options, LoggerInterface $logge
parent::__construct($options, $logger);

$this->web_parser = new \Kassner\LogParser\LogParser();

// Allow "at" # remote user format string.
// This can be removed if Kassner LogParser is updated to
// version >2.1.1 (see note in composer.json).
$this->web_parser->addPattern('%u', '(?P<user>(?:-|[\w\-\.@]+))');

if (isset($options->log_format)) {
$this->web_parser->setFormat($options->log_format);
}
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extra": {
"COMMENT": "If kassner/log-parser is updated to version >2.1.1, then the call to web_parser->addPattern in classes/ETL/DataEndpoint/WebServerLogFile.php (added in https://github.com/ubccr/xdmod/pull/1816) can be removed along with this 'extra' section."
},
"require": {
"php": "^5.4 || ^7.2",
"carlo/jquery-base64-file": "^1.0",
Expand Down

0 comments on commit 3bff18e

Please # to comment.