Imported Upstream version 2.7
[ossec-hids.git] / contrib / ossec_report_contrib.pl
index 4278dfb..0ec061b 100755 (executable)
@@ -27,8 +27,8 @@ while(<>){
                $stats{$alerthost}{rule}{$rule}++;
                $stats{$alerthost}{level}{$level}++;
                $stats{$alerthost}{description}{$description}++;
-               $stats{$alerthost}{srcip}{$srcip}++;
-               $stats{$alerthost}{user}{$user}++;
+               if (defined $srcip) { $stats{$alerthost}{srcip}{$srcip}++; }
+               if (defined $user)  { $stats{$alerthost}{user}{$user}++; }
                next ;
        }
        if (m/^\*\* Alert ([0-9]+).([0-9]+):(.*)$/){