multiline filter
Posted: Thu Oct 01, 2015 11:24 am
Trying to get multiline filters working but it keeps crashing logstash. These are coming in via a log4j input so I think I'm correct in applying a filter for this instead of using the multiline input. The first event has the host name of the device sending the log, and the second event has the details of the log itself; in this case a HDD temp alarm. These always come in as an unknown event type as the DVR's are sending events to a server of ours that process transactions, that server doesn't need to know what to do with these so it just logs them. We're trying to get those logs parsed out into a usable format for reporting in NLS. Think I'm doing something wrong with the filter syntax which is crashing logstash, any help would be appreciated.
Filter matches the second event and should be joining it to the first. Regexp seems to be ok, when I test it.
First Event
Second Event
***edited out a name that is not important.
Filter matches the second event and should be joining it to the first. Regexp seems to be ok, when I test it.
Code: Select all
if [type] == "mytype" {
multiline {
pattern => "(\W|^)Received\san\sunknown\sevent\stype(\W|$)"
negate => true
what => previous
}
}Code: Select all
{
"_index": "logstash-2015.10.01",
"_type": "mytype",
"_id": "txKLBkFGS6GPGfg_dhfVtw",
"_score": null,
"_source": {
"message": "Unknown event from some thing",
"@version": "1",
"@timestamp": "2015-10-01T16:08:57.032Z",
"type": "mytype",
"host": "10.0.1.141:54633",
"path": "com.mycompany.east.driver.dvr.mydvrtype.comm.DvrEventHandler",
"priority": "ERROR",
"logger_name": "com.mycompany.east.driver.dvr.mydvrtype.comm.DvrEventHandler",
"thread": "Incoming Data Listener",
"class": "com.mycompany.east.driver.dvr.mydvrtype.comm.DvrEventHandler",
"file": "DvrEventHandler.java:157",
"method": "processFT2Event",
"bundle.id": "84",
"bundle.version": "2.1.3",
"bundle.name": "com.mycompany.east.driver.dvr.mydvrtype"
},
"sort": [
1443715737032
]
}Code: Select all
{
"_index": "logstash-2015.10.01",
"_type": "mytype",
"_id": "3zUNQeTQRUyP_NLIACzFbQ",
"_score": null,
"_source": {
"message": "Received an unknown event type - SMART HDD ALERT TEMP. Raw event = S4007601-10-15 12:08:09 R Z000 0102 SYST 001 SYSTEM |SMART HDD ALERT TEMP|?| 0|0000000000000000",
"@version": "1",
"@timestamp": "2015-10-01T16:08:57.006Z",
"type": "mytype",
"host": "10.0.1.141:54633",
"path": "com.mycompany.east.driver.dvr.mydvrtype.ft2.events.FT2DvrEvent",
"priority": "ERROR",
"logger_name": "com.mycompany.east.driver.dvr.mydvrtype.ft2.events.FT2DvrEvent",
"thread": "Incoming Data Listener",
"class": "com.mycompany.east.driver.dvr.mydvrtype.ft2.events.FT2DvrEvent",
"file": "FT2DvrEvent.java:152",
"method": "parseAlarmDescription",
"bundle.id": "84",
"bundle.version": "2.1.3",
"bundle.name": "com.mycompany.east.driver.dvr.mydvrtype"
},
"sort": [
1443715737006
]
}***edited out a name that is not important.