cowrie/doc/elk/logstash-cowrie.conf

67 lines
1.5 KiB
Plaintext
Raw Normal View History

2014-11-17 19:05:26 +00:00
input {
# this is the actual live log file to monitor
2014-11-17 19:05:26 +00:00
file {
2015-05-12 14:57:29 +00:00
path => ["/home/cowrie/cowrie-git/log/cowrie.json"]
2016-07-18 21:02:47 +00:00
codec => json
2015-05-12 14:57:29 +00:00
type => "cowrie"
2014-11-17 19:05:26 +00:00
}
# this is to send old logs to for reprocessing
2016-07-18 21:02:47 +00:00
#tcp {
# port => 3333
# type => "cowrie"
#}
2014-11-17 19:05:26 +00:00
}
filter {
2015-05-12 14:57:29 +00:00
if [type] == "cowrie" {
2014-11-17 19:05:26 +00:00
json {
source => message
}
2014-11-17 19:05:26 +00:00
date {
match => [ "timestamp", "ISO8601" ]
}
if [src_ip] {
2014-11-17 20:38:23 +00:00
dns {
reverse => [ "src_host", "src_ip" ]
action => "append"
}
2014-11-17 19:05:26 +00:00
geoip {
source => "src_ip"
target => "geoip"
database => "/opt/logstash/vendor/geoip/GeoLiteCity.dat"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
}
2014-11-18 10:40:29 +00:00
geoip {
source => "src_ip"
database => "/opt/logstash/vendor/geoip/GeoIPASNum.dat"
}
2014-11-17 19:05:26 +00:00
mutate {
convert => [ "[geoip][coordinates]", "float" ]
}
}
}
}
output {
2015-05-12 14:57:29 +00:00
if [type] == "cowrie" {
elasticsearch {
2016-07-18 21:02:47 +00:00
hosts => ["localhost:9200"]
}
2014-11-17 19:05:26 +00:00
file {
2015-05-12 14:57:29 +00:00
path => "/tmp/cowrie-logstash.log"
2014-11-17 19:05:26 +00:00
codec => json
}
stdout {
codec => rubydebug
}
}
}