Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multi-line logs #1

Closed
otisg opened this issue Aug 12, 2015 · 1 comment
Closed

Add support for multi-line logs #1

otisg opened this issue Aug 12, 2015 · 1 comment

Comments

@otisg
Copy link
Member

otisg commented Aug 12, 2015

e.g. Java exception stack traces

Inspiration for how (not to) handle this could be taken from Logstash or rsyslog.

@megastef
Copy link
Contributor

Multi-line logs need a delimiter for the text block (e.g. the date). Each pattern with multi-line support must have the property "blockStart" (a regular expression).

Example:

INFO [main ] 2012-02-10 09:15:33,112 DatabaseDescriptor.java  (line 495 )
     Found table data in data directories. Consider using the CLI to define your schema.
INFO  [main ] 2012-02-10 09:15:33,135 CommitLog.java  (line 166 )
     No commitlog files found; skipping replay

and the related pattern definition:

- # Apache Cassandra
  type: apache_cassandra
  sourceName: !!js/regexp cassandra
  # multi-line, start sequence
  blockStart: !!js/regexp ^\S+\s\[.+\]\s\d{4}-\d{2}-\d{2}\s[\d|\:]+,\d+\s
  match:
    - regex: !!js/regexp (\S+)\s\[(.+)\]\s(\d{4}-\d{2}-\d{2}\s[\d|\:]+,\d+)\s(.+.java)\s+\(line\s(\d+).+\n\s+(.*)
      fields: [severity,module,ts,java_file,code_line,message]
      dateFormat: YYYY-MM-DD HH:mm:ss,SS

Results in:

severity:   INFO
module:     main 
ts:         2012-02-10 09:15:33,112
java_file:  DatabaseDescriptor.java
code_line:  495
message:    Found table data in data directories. Consider using the CLI to define your schema.
@timestamp: Fri Feb 10 2012 09:15:33 GMT+0100 (CET)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants