Compare commits

...

2 commits

Author SHA1 Message Date
439f0b3671 Fixed parsing of \" in "". 2024-07-20 14:55:12 +02:00
030f895c5c Fixed collision ip generation. 2024-07-20 03:46:46 +02:00
2 changed files with 4 additions and 4 deletions

View file

@ -95,10 +95,10 @@ public final class AnonMap
}
// Check it does not already exist.
if ((this.map.get(result) == null) && (this.unmap.get(result) == null))
if ((this.unmap.get(result) == null) && (this.map.get(result) == null))
{
this.map.put(ip, result);
this.unmap.put(ip, result);
this.unmap.put(result, ip);
ended = true;
}
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org>
* Copyright (C) 2021-2024 Christian Pierre MOMON <christian@momon.org>
*
* This file is part of Logar, simple tool to manage http log files.
*
@ -39,7 +39,7 @@ public final class AccessLogParser implements LineParser
private static Logger logger = LoggerFactory.getLogger(AccessLogParser.class);
public static Pattern COMBINED_ACCESSLOG_LINE_PATTERN = Pattern.compile(
"^(?<remoteAddress>[a-zA-F0-9\\\\:\\\\.]+) - (?<remoteUser>[^\\[]+) \\[(?<datetime>[^\\]]+)\\] \"(?<request>[^\"]*)\" (?<status>\\d+) (?<bodyBytesSent>\\d+) \"(?<referer>[^\"]*)\" \"(?<userAgent>[^\"]*)\".*$");
"^(?<remoteAddress>[a-zA-F0-9\\\\:\\\\.]+) - (?<remoteUser>[^\\[]+) \\[(?<datetime>[^\\]]+)\\] \"(?<request>([^\"]|\\\")*)\" (?<status>\\d+) (?<bodyBytesSent>\\d+) \"(?<referer>([^\"]|\\\")*)\" \"(?<userAgent>([^\"]|\\\")*)\".*$");
/**
* Instantiates a new log parser.