Here is my Configuration file:
input {
tcp {
port => 5000
#type => syslog
}
udp {
port => 5000
#type => syslog
}
}
filter {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp}\s+%{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:[%{POSINT:syslog_pid}])?: %{GREEDYDATA:syslog_message}" }
remove_field => ["@version", "host", "message", "@timestamp"]
add_field => [ "received_at", "%{@timestamp}" ]
#add_field => [ "received_from", "%{host}" ]
}
syslog_pri { }
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
}
output {
stdout { codec => rubydebug }
}
Here is my Output :
{
"syslog_timestamp" => "Dec 8 23:11:57",
"syslog_hostname" => "reg-mx480-1.tlab.com",
"syslog_program" => "dcd",
"syslog_pid" => "79823",
"syslog_message" => "unknown encaps_ohead; dev ams0, encaps 0, flags 0x1, addr-fam 2, ifdp_type=104, overhead=-1\r",
"received_at" => "2015-12-15T22:57:56.856Z",
"syslog_severity_code" => 5,
"syslog_facility_code" => 1,
"syslog_facility" => "user-level",
"syslog_severity" => "notice",
"@timestamp" => "2015-12-09T07:11:57.000Z" <<< i need to remove this.
}
Though I am explicitly removing the @timestamp field, It is still appearing in output.