X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/aa57d14ae7d7439245c5f8b28bd9fd01889a8eeb..bd685982389b78a158921b7839bdeca501338d19:/support/rsyncstats diff --git a/support/rsyncstats b/support/rsyncstats index b8cd00ee..e770b9dd 100755 --- a/support/rsyncstats +++ b/support/rsyncstats @@ -12,7 +12,7 @@ use Getopt::Long; # You may wish to edit the next line to customize for your default log file. -$usage_file = "/var/adm/rsyncd.log"; +$usage_file = "/var/log/rsyncd.log"; # Edit the following lines for default report settings. # Entries defined here will be over-ridden by the command line. @@ -52,9 +52,22 @@ if ($only_section) { line: while () { +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 =~ /^>/) {