Skip to content

Commit 74283e9

Browse files
committed
Merge pull request #16 from u-s-p/multiline-codec
Multiline codec instead of multiline filter
2 parents 128666e + 64b4e79 commit 74283e9

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

logstash-modsecurity.conf

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,22 @@ input {
4545
charset => "US-ASCII"
4646
path => "/path/to/your/modsec/audit/logs/*.log"
4747
type => "mod_security"
48+
49+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50+
# merge all modsec events for a given entity into the same event.
51+
# so essentially the modsec -Z marker is used as the splitter
52+
# which is the end of each modsec logical event in the logfile
53+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
54+
codec => multiline {
55+
pattern => "^--[a-fA-F0-9]{8}-Z--$"
56+
negate => true
57+
what => previous
58+
}
4859
}
4960
}
5061

5162
filter {
5263

53-
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
54-
# merge all modsec events for a given entity into the same event.
55-
# so essentially the modsec -A marker is used as the splitter
56-
# which is the start of each modsec logical event in the logfile
57-
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58-
59-
multiline {
60-
pattern => "^--[a-fA-F0-9]{8}-Z--$"
61-
negate => true
62-
what => previous
63-
type => "mod_security"
64-
}
65-
66-
6764
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6865
# Due to the complexity of the collapsed single string
6966
# we get from multiline and the variance of exactly

0 commit comments

Comments
 (0)