-
-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: logs analysis scripts (#9382)
Commiting logs analysis scripts that were on off1 in /srv/off/logs --------- Co-authored-by: Alex Garel <[email protected]>
- Loading branch information
1 parent
9010d3e
commit 593b7a8
Showing
8 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ Thumbs.db | |
|
||
# Logs | ||
logs/ | ||
!scripts/utils/logs | ||
debug/ | ||
Store.debug.txt | ||
*.log | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/perl -w | ||
|
||
use strict; | ||
use warnings; | ||
|
||
my %ip = (); | ||
|
||
while (<STDIN>) { | ||
if ($_ =~ /(^\S+) /) { | ||
$ip{$1}++; | ||
} | ||
} | ||
|
||
foreach my $ip (sort {$ip{$a} <=> $ip{$b}} keys %ip) { | ||
print "$ip\t$ip{$ip}\n"; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/perl -w | ||
|
||
use strict; | ||
use warnings; | ||
|
||
my %ip = (); | ||
|
||
while (<STDIN>) { | ||
if ($_ =~ /(^\S+)\.(\d+) /) { | ||
$ip{$1}++; | ||
} | ||
} | ||
|
||
foreach my $ip (sort {$ip{$a} <=> $ip{$b}} keys %ip) { | ||
print "$ip\t$ip{$ip}\n"; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/perl -w | ||
|
||
use strict; | ||
use warnings; | ||
|
||
my %ip = (); | ||
|
||
while (<STDIN>) { | ||
if ($_ =~ /"([^"]+)"$/) { | ||
$ip{$1}++; | ||
} | ||
} | ||
|
||
foreach my $ip (sort {$ip{$a} <=> $ip{$b}} keys %ip) { | ||
print "$ip\t$ip{$ip}\n"; | ||
} | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr//bin/perl -w | ||
|
||
use strict; | ||
use warnings; | ||
|
||
my %subdomains = (); | ||
|
||
# input for script: /home/off/logs/access_log | ||
|
||
while (<STDIN>) { | ||
if ($_ =~ /\/([a-z-]+)\.openfoodfacts\.org/) { | ||
$subdomains{$1}++; | ||
} | ||
} | ||
|
||
foreach my $sd (sort {$subdomains{$b} <=> $subdomains{$a}} keys %subdomains) { | ||
print $sd . "\t" . $subdomains{$sd} . "\n"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/perl -w | ||
|
||
use strict; | ||
use warnings; | ||
|
||
my %errors = (); | ||
|
||
# [Tue Sep 13 11:03:23 2016] -e: Use of uninitialized value $tag in pattern match (m//) at /home/off/lib/ProductOpener/Tags.pm line 1811. | ||
|
||
while (<STDIN>) { | ||
|
||
chomp; | ||
my $line = $_; | ||
$line =~ s/\[.*?\] //; | ||
$errors{$line}++; | ||
} | ||
|
||
foreach my $error (sort {$errors{$a} <=> $errors{$b}} keys %errors) { | ||
|
||
print $errors{$error} . "\t" . $error . "\n"; | ||
|
||
} |