/[sysplogd]/sysplogd
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sysplogd

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3 by dpavlin, Fri Apr 10 21:22:01 2009 UTC revision 5 by dpavlin, Sat Apr 11 08:30:33 2009 UTC
# Line 11  my $port = 514; Line 11  my $port = 514;
11    
12  my $MAXLEN = 1524;  my $MAXLEN = 1524;
13    
14  my $dsn = 'DBI:Pg:dbname=syslog';  my $dsn = 'DBI:Pg:dbname=syslog;host=llin.lan';
15  my $user = 'dpavlin';  my $user = 'dpavlin';
16  my $debug = 0;  my $debug = 0;
17    
# Line 46  while(1) { Line 46  while(1) {
46          my $ip = join('.', unpack('C4',$ipaddr));          my $ip = join('.', unpack('C4',$ipaddr));
47          warn "# ",dump( $port, $ipaddr, $hostname, $buf );          warn "# ",dump( $port, $ipaddr, $hostname, $buf );
48    
49          if ( $buf=~/<(\d+)>(.*?):(.*)/ ) {          if ( $buf =~ /<(\d+)>\s*(\S*)\s*:\s*(.*)/ ) {
50                  my $level=$1 % 8;                  my $level=$1 % 8;
51                  my $fac=($1-$level) / 8;                  my $fac=($1-$level) / 8;
52                  $sth->execute( $ip, $hostname, $fac, $1, $level, $2, $3 );                  $sth->execute( $ip, $hostname, $fac, $1, $level, $2, $3 );
53            } else {
54                    $sth->execute( $ip, $hostname, undef, undef, undef, undef, $buf );
55          }          }
56  }  }

Legend:
Removed from v.3  
changed lines
  Added in v.5

  ViewVC Help
Powered by ViewVC 1.1.26