/usr/share/kannel/contrib/webalizer/split.pl is in kannel-extras 1.4.4-4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #!/usr/bin/perl -w
# This script reads access.log (pass it through multi-line first!) and
# split them by SMSC or Service
# Just define your service and smsc names as:
#
# SMSC: (smsc-id in smsc groups)
# <Client>-<Number>
#
# Service: (name in sms-service and sendsms-user)
# <Client>-<SVC>-<service_name>
# SVC = for user, MT or USER
# for service, MO or SERVICE
$dir = shift || "/tmp";
foreach $line (<>) {
$line =~ /^.{19} (.+) \[SMSC:(.*?)\] \[SVC:(.*?)\].*$/;
$status= $1; $smsc= $2; $service= $3;
if( $status =~ /Receive/) {
open(X, ">>$dir/$smsc.log");
} else {
open(X, ">>$dir/$service.log");
}
print X $line;
close(X);
}
|