Closed Sophist-UK closed 9 years ago
Any news on this PR? My ISP supports ipv6 connections to my web site, so this plugin needs to handle IPv6 addresses in the server logs.
Neither merged nor commented on.
Any news?
Hi @Sophist-UK
Sorry for the long delay. I was hoping to add some tests to IPv6 addresses, but it seems very difficult to find a good regex that does not fail in some edge cases.
If you (or anyone reading here) is interested in contributing with IPv6 tests, there is a good list of valid and invalid IPv6 addresses to take a look on.
Thanks!
The regex used was the result of reasonably extensive internet research.
However, for the purposes of log parsing, it is probably not essential for the regex to identify edge cases.
P.S. Apologies - but I realise that I have not added any automated tests.
This fix simplifies the ipv4 regex and adds support for recognising ipv6 addresses in log files for %a and %A.
Note: In the interests of simplicity we assume that ipv6 addresses in log files will be valid, and the ipv6 regex does will recognise all valid ipv6 addresses but will also pass some invalid ipv6 addresses i.e. 1:1:1:1:1:1:1::1:1:1:1:1:1:1 will pass.