2014-11-17 19:05:26 +00:00
|
|
|
input {
|
2015-02-04 06:50:17 +00:00
|
|
|
# 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
|
|
|
}
|
2015-02-04 06:50:17 +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
|
|
|
|
2015-02-04 07:08:36 +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" {
|
2015-02-04 20:50:49 +00:00
|
|
|
elasticsearch {
|
2016-07-18 21:02:47 +00:00
|
|
|
hosts => ["localhost:9200"]
|
2015-02-04 20:50:49 +00:00
|
|
|
}
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|