Skip to content

Instantly share code, notes, and snippets.

@itskenny0
Created July 10, 2018 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itskenny0/5b313109d123b534a01b297b7054c098 to your computer and use it in GitHub Desktop.
Save itskenny0/5b313109d123b534a01b297b7054c098 to your computer and use it in GitHub Desktop.
communigate password fail geoip logstash config
input {
beats {
port => 50441
ssl => false
}
}
filter {
if "communigate-log" in [tags] {
grok {
match => [ "message", "%{INT} (SMTPI|IMAP)-%{INT}\(\[%{IP:ip}\]?.+\) failed to open ACCOUNT\(%{DATA:account}\) %{DATA} Error Code=%{GREEDYDATA:errorcode}" ]
add_tag => ["auth-fail-smtp"]
}
geoip {
source => "ip"
target => "geoip"
add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
}
mutate {
convert => [ "[geoip][coordinates]", "float"]
}
}
grok {
match => [ "message", "%{MONTH:month} %{MONTHDAY:day} %{TIME:time} %{HOSTNAME:hostname} %{DATA} Failed password for %{WORD:username} from %{IP:ip}" ]
add_tag => ["auth-fail-ssh"]
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "n8gs-tz-%{+YYYY.MM.dd}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment