Hi all, I want to extract fields from modsecurity audit log, which is multiline log with sections A,B,…Z. I can merge multiline message of a single event using multiline feature in Graylog input. The result is as below:
###############################
message
–12aceb4f-A–
[14/Dec/2018:13:00:02 +0100] XAsbQiwgSSXTTqKkD3L2LQGgAAI ::1 45476 ::1 80
–12abeb4f-B–
GET / HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0
Accept: application/xml,application/xhtml+xml,text/html
Connection: Close
–12aceb4f-F–
HTTP/1.1 503 Service Temporarily Unavailable
Status: 503 Service Temporarily Unavailable
Retry-After: 3600
X-Content-Type-Options: nosniff
X-Frame-Options: sameorigin
Content-Length: 1130
Connection: close
Content-Type: text/html; charset=UTF-8
–12aceb4f-E–
#############################
I want to extract fields (such as Host, User-Agent, Status ) of all sections A, B … Z, of a modsecurity log. What is the most preferrable way to extract fields?
You don’t, once an extractor is active it will apply itself to any messages coming in on the input you’ve put the extractor on. For pipelines same story, pipeline will apply itself to any messages coming through a stream that the pipeline attaches to.