MHMDhub / enterprise-log-search-and-archive

Automatically exported from code.google.com/p/enterprise-log-search-and-archive
0 stars 0 forks source link

Unable to parse valid class id from log line #23

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. SSHD message send to syslog

What is the expected output? What do you see instead?
Parsed sshd logs

What version of the product are you using? On what operating system?
SVN checkout of ELSA.
syslog-ng 3.3.5

Please provide any additional information below.
Hi a get the following error when parsing this log line:

* ERROR [2012/05/14 15:38:21] /srv/syslogdata/elsa/node/elsa.pl (219) 
main::_process_batch 1243 Unable to parse valid class id from log line 
1336999101  10.30.1.1   sshd    system  Failed password for root from 172.16.1.2 port 
51058 ssh2                                              .  Only parsed into:
$VAR1 = [
          '1336999101',
          '10.30.1.1',
          'sshd',
          'system',
          'Failed password for root from 172.16.1.2 port 51058 ssh2'
        ];

Is there an invalid class id somewhere?? How can I find it?

Thank you

Original issue reported on code.google.com by thana...@gmail.com on 14 May 2012 at 12:45

GoogleCodeExporter commented 8 years ago
"system" should be a class ID as specified in the Syslog-NG template as 
${.classifier.class}.  Have you modified the syslog-ng.conf that ships with 
ELSA at all?  Also, is this a log from the local box?  There may be a change in 
syslog-ng 3.3.5, as the ELSA install should be installing 3.2.4.

Original comment by mchol...@gmail.com on 14 May 2012 at 1:31

GoogleCodeExporter commented 8 years ago
Hi 
Haven't changed the syslog-ng.conf and the template seems to be applied.
The log line is from a remote host
Also, is syslog-ng version affecting this stage of the processing?
\
thanks,

Original comment by thana...@gmail.com on 14 May 2012 at 1:52

GoogleCodeExporter commented 8 years ago
Looking through the source, this appears to happen when a pattern matches but 
the class is not defined.  When a rule doesn't match, the class is set to 
"unknown" and the elsa.pl script changes that to the class_id 1.  One remedy 
would be to make this true for "system" as well, but since this shouldn't 
occur, there must be something else going on.  Can you test this like this:

/usr/local/syslog-ng/bin/pdbtool match -p 
/usr/local/elsa/node/conf/patterndb.xml -P sshd -M "Failed password for root 
from 172.16.1.2 port 51058 ssh2"

You should get this back:
MESSAGE=Failed password for root from 172.16.1.2 port 51058 ssh2
PROGRAM=sshd
.classifier.class=12
.classifier.rule_id=12
i0=51058
s0=password
s1=root
s2=172.16.1.2
s3=ssh2
TAGS=.classifier.12

Original comment by mchol...@gmail.com on 14 May 2012 at 4:54

GoogleCodeExporter commented 8 years ago
I run the pdbtool :

./pdbtool match -p /srv/syslogdata/syslog-ng/var/patterndb.xml -P sshd -M 
"Failed password for root from 172.16.1.2 port 51058 ssh2"

The output is:

MESSAGE=Failed password for root from 172.16.1.2 port 51058 ssh2
PROGRAM=sshd
.classifier.class=system
.classifier.rule_id=aecda233-3d80-48cd-a72b-4896f58069c8
usracct.username=root
usracct.device=172.16.1.2
usracct.authmethod=password
usracct.service=ssh2
usracct.type=login
usracct.sessionid=
usracct.application=sshd
secevt.verdict=REJECT
TAGS=.classifier.system,usracct,secevt

Can there be an issue with my patterndb.xml file, not delegating variables to 
i0,s0...etc?

Original comment by thana...@gmail.com on 15 May 2012 at 10:13

GoogleCodeExporter commented 8 years ago
Ok, it appears you've got some of the shipped Balabit patterndb patterns 
somewhere, as this is a rule not provided by ELSA.  Check your syslog-ng.conf 
file for what pattern files and directories are being loaded, and in one of 
those files and disable any that aren't /usr/local/elsa/node/conf/patterndb.xml.

Original comment by mchol...@gmail.com on 15 May 2012 at 1:25

GoogleCodeExporter commented 8 years ago
Closing until I hear back regarding location of patterndb.xml.

Original comment by mchol...@gmail.com on 31 May 2012 at 2:43