My log sample is something like this:
2017-01-03 03:38:18 +0000 field1: 123 field2: 321
field3: 1133 field4: 0901
2017-01-03 03:38:19 +0000 field1: 523 field2: 521
field3: 533 field4: 509
Im very new to this. How should I write the regex?
My log sample is something like this:
2017-01-03 03:38:18 +0000 field1: 123 field2: 321
field3: 1133 field4: 0901
2017-01-03 03:38:19 +0000 field1: 523 field2: 521
field3: 533 field4: 509
Im very new to this. How should I write the regex?
With the file{} input, you should use the multiline codec (rather than the multiline{} filter), e.g.:
input {
file {
path => "..."
codec => multiline {
negate => "true"
pattern => "^%{YEAR}"
what => "previous"
}
}
}
Which you would read as, "if the line doesn't start with a year, keep it with the previous line".