Improved access log pattern.
This commit is contained in:
parent
c2fd782860
commit
5e1f2d68d4
1 changed files with 2 additions and 2 deletions
|
@ -175,7 +175,7 @@ public class HttpAccessLogAnalyzer
|
||||||
this.counters.inc("metrics.http.pages", year, yearMonth, yearWeek, date);
|
this.counters.inc("metrics.http.pages", year, yearMonth, yearWeek, date);
|
||||||
}
|
}
|
||||||
|
|
||||||
// metrics.http.status.XXX
|
// metrics.http.status.XXXX
|
||||||
String status = String.valueOf(log.getStatus().getCode());
|
String status = String.valueOf(log.getStatus().getCode());
|
||||||
this.counters.inc("metrics.http.status." + status, year, yearMonth, yearWeek, date);
|
this.counters.inc("metrics.http.status." + status, year, yearMonth, yearWeek, date);
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ public class HttpAccessLogAnalyzer
|
||||||
// log_format combined '$remote_addr - $remote_user [$time_local] '
|
// log_format combined '$remote_addr - $remote_user [$time_local] '
|
||||||
// '"$request" $status $body_bytes_sent '
|
// '"$request" $status $body_bytes_sent '
|
||||||
// '"$http_referer" "$http_user_agent"';
|
// '"$http_referer" "$http_user_agent"';
|
||||||
String combinedPattern = "^(?<remoteAddress>[a-zA-F0-9\\\\:\\\\.]+) - (?<remoteUser>\\S+) \\[(?<time>[^\\]]+)\\] \"(?<request>[^\"]*)\" (?<status>\\d+) (?<bodyBytesSent>\\d+) \"(?<referer>[^\"]*)\" \"(?<userAgent>[^\"]*)\".*$";
|
String combinedPattern = "^(?<remoteAddress>[a-zA-F0-9\\\\:\\\\.]+) - (?<remoteUser>[^\\[]+) \\[(?<time>[^\\]]+)\\] \"(?<request>[^\"]*)\" (?<status>\\d+) (?<bodyBytesSent>\\d+) \"(?<referer>[^\"]*)\" \"(?<userAgent>[^\"]*)\".*$";
|
||||||
|
|
||||||
Pattern pattern = Pattern.compile(combinedPattern);
|
Pattern pattern = Pattern.compile(combinedPattern);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue