diff options
| author | Paul Buetow <paul@buetow.org> | 2024-12-04 23:12:47 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-12-04 23:12:47 +0200 |
| commit | a7312158d0484f12cd3f186717638f354266d26b (patch) | |
| tree | cafad4d055a75bdb352dd26b1cd0d7abb7c4427f | |
| parent | ddb5fe3fddef734a6cd99c476ab5ae1d16413b06 (diff) | |
jo
| -rw-r--r-- | foostats.pl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/foostats.pl b/foostats.pl index cf259ef..042da0d 100644 --- a/foostats.pl +++ b/foostats.pl @@ -74,7 +74,9 @@ package Foostats::Logreader { my sub parse_web_line (@line) { my ($date, $time) = parse_date $line[4]; return undef if $date < $last_processed_date; - my ($ip_hash, $ip_proto) = anonymize_ip $line[-2]; + # X-Forwarded-For? + my $ip = $line[-2] eq '-' ? $line[1] : $line[-2]; + my ($ip_hash, $ip_proto) = anonymize_ip $ip; return { proto => 'web', |
