/[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 13 by dpavlin, Sat Apr 11 12:17:53 2009 UTC revision 16 by dpavlin, Mon Apr 13 18:40:32 2009 UTC
# Line 47  CREATE TABLE log ( Line 47  CREATE TABLE log (
47          id              serial,          id              serial,
48          timestamp       timestamp default now(),          timestamp       timestamp default now(),
49          ip              inet not null,          ip              inet not null,
50          hostname        text not null,          hostname        text,
51          message         text,          message         text,
52          level           int,          level           int,
53          facility        int,          facility        int,
# Line 93  my $sth_log_full = $dbh->prepare(qq{ Line 93  my $sth_log_full = $dbh->prepare(qq{
93  });  });
94    
95  my $sth_log_unparsed = $dbh->prepare(qq{  my $sth_log_unparsed = $dbh->prepare(qq{
96          insert into log (ip,hostname,messsage) values (?,?,?)          insert into log (ip,hostname,message) values (?,?,?)
97  });  });
98    
99    
# Line 120  while(1) { Line 120  while(1) {
120          my $ip = join('.', unpack('C4',$ipaddr));          my $ip = join('.', unpack('C4',$ipaddr));
121          my @values = ( $ip, $hostname, $buf );          my @values = ( $ip, $hostname, $buf );
122    
123          if ( $buf =~ /<(\d+)>\s*(\S*)\s*:\s*(.*)/ ) {          if ( $buf =~ /<(\d+)>\w\w\w \d+ \d\d:\d\d:\d\d\s*(\S*)\s*:\s*(.*)/ ) {
124                  $values[2] = $3;                  $values[2] = $3;
125                  my $level    = $1 % 8;                  my $level    = $1 % 8;
126                  my $facility = ( $1-$level ) / 8;                  my $facility = ( $1-$level ) / 8;

Legend:
Removed from v.13  
changed lines
  Added in v.16

  ViewVC Help
Powered by ViewVC 1.1.26