@raihan
Refer below logstash config file
input {
udp {
port => 30000
type => "fortigate-syslog"
codec => plain {
charset => "ISO-8859-1"
}
}
filter {
if [type] == "fortigate-syslog"
{
mutate {
gsub => [
"message", "<.*>", ""
]
}
grok
{
match => [ "message", "(?<msg>.*)" ]
}
kv { source => "msg" }
mutate {
add_field => ["log_timestamp", "%{date} %{time}"]
rename => [ "crlevel" , "severity_level" ]
rename => [ "devname" , "devicename" ]
rename => [ "devid" , "deviceid" ]
rename => [ "srcintf" , "srcinterface" ]
rename => [ "dstintf" , "dstinterface" ]
rename => [ "proto" , "protocol" ]
rename => [ "appcat" , "appcategory" ]
rename => [ "inintf" , "srcinterface" ]
rename => [ "outintf" , "dstinterface" ]
rename => [ "locport" , "srcport" ]
rename => [ "remport" , "dstport" ]
rename => [ "locip" , "srcip" ]
rename => [ "remip" , "dstip" ]
rename => [ "logdesc" , "log_description" ]
rename => [ "peer_notif" , "peer_notification" ]
rename => [ "dir" , "direction" ]
rename => [ "type" , "data_type" ]
rename => [ "log_type", "type" ]
rename => [ "level", "log_level" ]
rename => [ "sessionid", "session_id" ]
rename => [ "action", "action_type" ]
rename => [ "policyid", "policy_id" ]
rename => [ "sentbyte", "sent_bytes" ]
rename => [ "rcvdbyte", "input_bytes" ]
rename => [ "sentpkt", "sent_packets" ]
rename => [ "rcvdpkt", "input_packets" ]
convert => [ "srcport", "integer"]
convert => [ "dstport", "integer"]
convert => [ "protocol", "integer"]
convert => [ "duration", "integer"]
convert => [ "policy_id", "integer"]
convert => [ "session_id", "integer"]
convert => [ "sent_bytes", "integer"]
convert => [ "input_bytes", "integer"]
convert => [ "sent_packets", "integer"]
convert => [ "input_packets", "integer"]
remove_field => ["msg", "full_message"]
}
date {
match => [ "log_timestamp", "YYYY-MM-dd HH:mm:ss", "YYYY-MM-dd HH:mm:ss.ZZZ" ]
target => "log_timestamp"
}
}
}
output {
gelf {
host => "192.168.1.100"
port => 5000
}
}