i'm not succes sparate ip and port
log:
<164> USG6300 %%01SEC/4/ATCKDF(l): AttackType="ICMP unreachable attack", slot="0", receive interface="TEST GE1/0/0(TEST) ", proto="ICMP", src="10.20.20.131:0 125.167.15.161:0 147.75.111.32:0 223.202.110.11:0 36.74.149.118:0 36.86.63.182:0 203.190.242.244:0 ", dst="192.168.137.2:0 192.168.137.9:0 192.168.137.34:0 192.168.137.1:0 192.168.137.2:0 ", begin time="2019-01-28 17:06:33", end time="2019-01-28 17:07:02", total packets="92", max speed="0", User="", Action="discard".
this is configuration logstash.conf
input {
udp {
port => 514
type => syslog
}
}
filter {
if [type] == "syslog" {
grok {
match => { "message" => "%{HUAWEI_ATCKDEF}"}
}
mutate { add_field => { "ip" => "%{attack.src}" "port" => "%{attack.src}" } }
mutate { gsub => [ "attack.src_IP", ":[0-9]+ ", " ", "attack.src_port", "[0-9\.]+:", "" ] }
# mutate {
# split => {"attack.src" => " "}
# split => {"attack.dst" => " "}
# split => {"ids.src_ip" => " "}
# split => {"ids.dst_ip" => " "}
# }
geoip {
source => "ids.src_ip"
}
geoip {
source => "ids.dst_ip"
}
mutate{
remove_tag => ["_geoip_lookup_failure"]
}
translate {
field => "syslog.program"
destination => "program"
override => "false"
dictionary_path => "/etc/logstash/translate.yml"
}
syslog_pri { }
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
if "_grokparsefailure" in [tags] {
drop { }
}
}
this is grok configuration :
HUAWEI %{TEST3}%{NUMBER}%{TEST3} %{SYSLOGHOST:hostname} %{DATA:syslog.program}(?:[%{POSINT:syslog.pid}])?:
HUAWEI_ATCKDEF %{HUAWEI} AttackType="%{DATA:attack.type}", slot="%{DATA:attack.slot}", receive interface="%{DATA:receive_interface}", proto="%{DATA:attack.protocol}", src="%{TEST7}", dst="%{TEST7}", begin time="%{TEST8:time.begin}", end time="%{TEST8:time.end}", total packets="%{DATA:attack.total_packets}", max speed="%{NUMBER:attack.max_speed}", User="%{DATA:attack.user}", Action="%{DATA:action}".
TEST3 ([<>]+)
TEST7 ([(?%{TEST4}( %{TEST4})*)]+)
TEST8 %{TEST6} %{NOTSPACE}
TEST6 %{YEAR}-%{MONTHNUM}-%{MONTHDAY}
any idea my problem ?