Remove date from syslog message

Hello,

I'm building a server logs, the server receive logs from network equipments (Juniper, Ericsson, Cisco, Huawei and Nokia). The server does forward the logs to logstash server on port 55514.

Analyzing the logs, logs from Juniper, on message filed, the date is removed, but logs from Ericsson the date does keeping.

My configuration:

input {
syslog {
port => 55514
}
}

filter {
syslog_pri{}
}

output {
stdout { codec => rubydebug }
}

Log from Juniper:

{
"@version" => "1",
"@timestamp" => 2019-03-03T18:37:07.000Z,
"logsource" => "RAGGFSA01-re0",
"host" => "10.171.32.14",
"message" => "fpc4 MQCHIP(0) MALLOC DPage Free-bits Memory parity error ",
"facility" => 21,
"priority" => 171,
"severity" => 3,
"facility_label" => "local5",
"severity_label" => "Error",
"syslog_facility_code" => 1,
"syslog_facility" => "user-level",
"syslog_severity" => "notice",
"syslog_severity_code" => 5,
"timestamp" => "Mar 3 15:37:07"
}

Log from Ericsson:

{
"@version" => "1",
"@timestamp" => 2019-03-03T16:36:57.000Z,
"logsource" => "se-cge1b",
"host" => "10.200.35.220",
"message" => "Mar 3 15:37:06: %AAA-5-NOTICE: [local] administrator: (bln3_script) logged in via tty: /dev/ttyp0, host: 10.200.1.135 59705\n",
"facility" => 23,
"priority" => 189,
"severity" => 5,
"facility_label" => "local7",
"severity_label" => "Notice",
"syslog_facility_code" => 1,
"syslog_facility" => "user-level",
"syslog_severity" => "notice",
"syslog_severity_code" => 5,
"timestamp" => "Mar 3 13:36:57"
}

I would like remode the date from Ercisson's log, how can I to do that?

You could do it with something like

    grok { match => { "message" => "^%{MONTH} %{MONTHDAY} %{TIME}: %{GREEDYDATA:[@metadata][restOfLine]}" } }
    if "_grokparsefailure" not in [tags] {
        mutate { copy => { "[@metadata][restOfLine]" => "message" } }
    } else {
        mutate { remove_tag => [ "_grokparsefailure" ] }
    }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.