{
    "description": "Pipeline for parsing Syslog messages.",
    "processors": [
        {
            "grok": {
                "field": "message",
                "patterns": [
                    "%{SYSLOGTIMESTAMP:system.syslog.timestamp} %{SYSLOGHOST:host.hostname} %{DATA:process.name}(?:\\[%{POSINT:process.pid:long}\\])?: %{GREEDYMULTILINE:system.syslog.message}",
                    "%{SYSLOGTIMESTAMP:system.syslog.timestamp} %{GREEDYMULTILINE:system.syslog.message}",
                    "%{TIMESTAMP_ISO8601:system.syslog.timestamp} %{SYSLOGHOST:host.hostname} %{DATA:process.name}(?:\\[%{POSINT:process.pid:long}\\])?: %{GREEDYMULTILINE:system.syslog.message}"
                ],
                "pattern_definitions" : {
                    "GREEDYMULTILINE" : "(.|\n)*"
                },
                "ignore_missing": true
            }
        },
        {
            "remove": {
                "field": "message"
            }
        },
        {
            "rename": {
                "field": "system.syslog.message",
                "target_field": "message",
                "ignore_missing": true
            }
        },
        {
            "date": {
                "field": "system.syslog.timestamp",
                "target_field": "@timestamp",
                "formats": [
                    "MMM  d HH:mm:ss",
                    "MMM dd HH:mm:ss",
                    "yyyy-MM-dd'T'HH:mm:ss.SSSSSSZZ"
                ],
                {< if .convert_timezone >}"timezone": "{{ event.timezone }}",{< end >}
                "ignore_failure": true
            }
        },
        {
            "remove": {
                "field": "system.syslog.timestamp"
            }
        }
    ],
    "on_failure" : [{
        "set" : {
            "field" : "error.message",
            "value" : "{{ _ingest.on_failure_message }}"
        }
    }]
}
