linha do arquivo de log
4/10/2024--06:00pm guest 192.168.1.2 https://nixnut.nz/home/accounts/hosting.cgi?action=getonline Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
no arquivo logview eu tenho
open (FILE, "tail -$form{'howmany'} $file | tail -$form{'howmany'} |") or die "Opening $file: $!";
while (<FILE>) {
chomp;
s/^\"//;
s/\"$//;
my ($date, $user, $host, $page, $browser) = split(' ', $_);
print "<tr bgcolor=black>";
print "<td bgcolor=white align=left valign=top>$font $date</td>";
print "<td bgcolor=white align=left valign=top><a href=http://nixnut.nz/$user target=_blank>$font $user</a></td>";
print "<td bgcolor=white align=left valign=top>$font <a href=https://www.iptolocation.io/ip-lookup/$host target=_blank>$host</a></td>";
print "<td bgcolor=white align=left valign=top>$font <a href=http://$host target=_blank>$host</a></td>";
print "<td bgcolor=white align=left valign=top><a href=$page target=_blank>$font $page</a></td>";
print "<td bgcolor=white align=left valign=top>$font $browser</td>";
print "</tr>\n";
}
close (FILE);
a saída é
4/10/2024--06:00pm guest 192.168.1.2 192.168.1.2 https://nixnut.nz/home/accounts/hosting.cgi?action=getonline Mozilla/5.0
faltando o useragent completo devido a espaços
Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0