I am still getting failures, though a small amount of documents actually passed
This is one such failure
{
"_index": "failed-filebeat-2016.12.06",
"_type": "log",
"_id": "AVjSAWgR6UaCJE7zkPWr",
"_version": 1,
"_score": 1,
"_source": {
"@timestamp": "2016-12-06T02:38:42.154Z",
"offset": 354,
"beat": {
"hostname": "CPX-I54LIOPVP3L",
"name": "CPX-I54LIOPVP3L",
"version": "5.0.1"
},
"input_type": "log",
"source": "<source>",
"message": "[ERROR] 2016-11-20 09:47:03.062 [Handler] - Unable to get Transaction Id: java.util.NoSuchElementException",
"type": "log",
"errorMsg": "Unable to get Transaction Id: java.util.NoSuchElementException"
}
}
However, i seem to be getting some documents which passed too, an example:
{
"_index": "log-index-2016-11-01",
"_type": "log",
"_id": "AVjSTDL-eEOgLibY-E5L",
"_version": 1,
"_score": 1,
"_source": {
"handler": "Handler",
"offset": 472,
"input_type": "log",
"source": "",
"message": "[ERROR] 2016-11-20 09:47:03.063 [Handler] - Unable to get Transaction Id: java.util.NoSuchElementException",
"type": "log",
"logTime": "2016-11-20 09:47:03.063",
"errorMsg": "Unable to get Transaction Id: java.util.NoSuchElementException",
"@timestamp": "2016-11-20T09:47:03.063Z",
"loglevel": "ERROR",
"beat": {
"hostname": "CPX-I54LIOPVP3L",
"name": "CPX-I54LIOPVP3L",
"version": "5.0.1"
}
}
}
This is my .json file:
{
"description" : "Filter for logs",
"processors": [
{
"grok": {
"field": "message",
"patterns": [
"(?m)\\[%{DATA:loglevel}\\] %{DATETIME:logTime} \\[%{DATA:handler}\\] - %{GREEDYDATA:errorMsg}"
],
"pattern_definitions" : {
"DATETIME" : "%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:?%{MINUTE}(?::?%{SECOND})"
}
}
},
{
"date": {
"field": "logTime",
"formats": ["yyyy-MM-dd hh:mm:ss.SSS"]
}
},
{
"date_index_name" : {
"field" : "@timestamp",
"index_name_prefix" : "log-index-",
"date_rounding" : "M"
}
}
],
"on_failure" : [
{
"set" : {
"field" : "_index",
"value" : "failed-{{ _index }}"
}
}
]
}