Skip to content

Commit

Permalink
Merge pull request #16 from u-s-p/multiline-codec
Browse files Browse the repository at this point in the history
Multiline codec instead of multiline filter
  • Loading branch information
bitsofinfo committed Oct 30, 2015
2 parents 128666e + 64b4e79 commit 74283e9
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions logstash-modsecurity.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,22 @@ input {
charset => "US-ASCII"
path => "/path/to/your/modsec/audit/logs/*.log"
type => "mod_security"

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# merge all modsec events for a given entity into the same event.
# so essentially the modsec -Z marker is used as the splitter
# which is the end of each modsec logical event in the logfile
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
codec => multiline {
pattern => "^--[a-fA-F0-9]{8}-Z--$"
negate => true
what => previous
}
}
}

filter {

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# merge all modsec events for a given entity into the same event.
# so essentially the modsec -A marker is used as the splitter
# which is the start of each modsec logical event in the logfile
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

multiline {
pattern => "^--[a-fA-F0-9]{8}-Z--$"
negate => true
what => previous
type => "mod_security"
}


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Due to the complexity of the collapsed single string
# we get from multiline and the variance of exactly
Expand Down

0 comments on commit 74283e9

Please sign in to comment.