Skip to content

Instantly share code, notes, and snippets.

@c7h c7h/
Created Dec 9, 2015

What would you like to do?
logfile evaluation
my $user_c = 0;
my $user_min = 0;
my @ip = ();
while(<>) {
if (m/(^\w+).*(\d{2}:\d{2})/) {
if ($1 eq 'christoph'){
$user_c++; # user_zaehler erhöhen
$user_min =+ $2
if (m/((?:\d{1,3}\.){3}\d{1,3})/){
push @ip, $1;
print "IP-Adressen:\n";
foreach (@ip){
print $_."\n";
print "ipsarray @ip";
print "\n";
print "user christoph war $user_c mal angemeldet ($user_min lang)\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.