summaryrefslogtreecommitdiff
path: root/support/rsyncstats
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-03-13 16:45:24 +0000
committerWayne Davison <wayned@samba.org>2006-03-13 16:45:24 +0000
commit1618c9e6d179fc46285cf556c5bb090ed0e9e503 (patch)
tree2cf68fb82c505b47a97d361a9dba18318c6e1644 /support/rsyncstats
parentba0147ac42fcae0b80071185b51fda4527e0d03a (diff)
downloadrsync-1618c9e6d179fc46285cf556c5bb090ed0e9e503.tar.gz
Improved the regex to match syslog lines and be easier to read.
Diffstat (limited to 'support/rsyncstats')
-rwxr-xr-xsupport/rsyncstats17
1 files changed, 15 insertions, 2 deletions
diff --git a/support/rsyncstats b/support/rsyncstats
index 908e3d94..e770b9dd 100755
--- a/support/rsyncstats
+++ b/support/rsyncstats
@@ -52,9 +52,22 @@ if ($only_section) {
line: while (<LOG>) {
+my $syslog_prefix = '\w\w\w +\d+ \d\d:\d\d:\d\d \S+ rsyncd';
+my $rsyncd_prefix = '\d\d\d\d/\d\d/\d\d \d\d:\d\d:\d\d ';
+
next unless ($day,$time,$op,$host,$module,$file,$bytes)
- = m#^ (\d+/\d\d/\d\d)\s+(\d\d:\d\d:\d\d)\s+\[\d+\]\s+(send|recv|[<>]f\S+)\s+
- (\S+)\s+\[\d+\.\d+\.\d+\.\d+\]\s+(\S+)\s+\(\S*\)\s+(.*)\s+(\d+) $ #x;
+ = m{^
+ ( \w\w\w\s+\d+ | \d+/\d\d/\d\d ) \s+ # day
+ (\d\d:\d\d:\d\d) \s+ # time
+ [^[]* \[\d+\]:? \s+ # pid (ignored)
+ (send|recv|[<>]f\S+) \s+ # op (%o or %i)
+ (\S+) \s+ # host
+ \[\d+\.\d+\.\d+\.\d+\] \s+ # IP (ignored)
+ (\S+) \s+ # module
+ \(\S*\) \s+ # user (ignored)
+ (.*) \s+ # file name
+ (\d+) # file length in bytes
+ $ }x;
# TODO actually divide the data by into send/recv categories
if ($op =~ /^>/) {