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

logstash multiline codec not working as expected #556

Open
SaiManoj1992 opened this issue Mar 28, 2016 · 0 comments
Open

logstash multiline codec not working as expected #556

SaiManoj1992 opened this issue Mar 28, 2016 · 0 comments

Comments

@SaiManoj1992
Copy link

Below is the config file

input {
file {
path => ["Records.log"]
sincedb_path => "/dev/null"
start_position => "beginning"
codec => multiline {
pattern => "^[\d]{4}-[\d]{2}-[\d]{2} "
negate => true
what => "previous"
}
}
}

filter {
mutate {
gsub => ['message', "\n", " "]
gsub => ['message', "\t", " "]
}
grok {
patterns_dir => "patterns"
match => "%{START_TIME:START_TIME:date} %{LOGLEVEL1:loglevel1}"
}
date {
match => [ "START_TIME" , "yyyy-MM-dd HH:mm:ss.SSS" ]
}

    if "_grokparsefailure" in [tags] { drop {} }

}
output {
stdout {
codec => rubydebug
}
}

Below are the patterns used

YEAR (\d){4}
MONTHNUM (\d){2}
MONTHDAY (\d){2}
DATE %{YEAR}[/-]%{MONTHNUM}[/-]%{MONTHDAY}

HOUR (\d){2}
MINUTE (\d){2}
SECOND (\d){2}
MILLISECOND (\d){3}

START_TIME %{DATE} %{TIMESTAMP}

LOGLEVEL1 ([!-Ó¶a-z0-9$.+!'(){},~:;=@#&%-?/"//<>|\t ]_)+

Below are the records I'm trying to load

2016-03-18 00:00:00.000 ABC DEF GHI
2016-03-18 00:00:00.000
THIS IS A MULTILINE
2016-03-18 00:00:00.000 THIS IS NOT A MULTILINE
2016-03-18 00:00:00.000 ABC DEF GHI

But I'm not able to match the multiline data. Could anyone please help with this?

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

1 participant