I am trying to implement logstash on my openvpn server, but I get the following error:
GeoIP Filter in ECS-Compatiblity mode requires a `target` when `source` is not an `ip` sub-field, eg. [client][ip]>
My logstash file looks as follows, which I took from this gist https://gist.github.com/soulsearcher/68fa902298e59dc4d70696862244e778 :
input {
beats {
port => 5044
}
}
filter {
grok {
match => {
"message" => "%{SYSLOGBASE} %{USER:user}/%{IP:source_ip}:%{POSINT:source_port} SENT CONTROL \[%{USER:user1}\]: \'%{DATA:msg}\' \(status=%{INT:status_code}\)"
}
remove_field => ["user1"]
match => {
"message" => "%{SYSLOGBASE} %{IP:source_ip}:%{POSINT:source_port} SENT CONTROL \[%{USER:user}\]: \'%{DATA:msg}\' \(status=%{INT:status_code}\)"
}
}
geoip {
source => "source_ip"xy
}
if [msg] =~ "PUSH_REPLY" {
mutate {
replace => { type => "openvpn_access" }
}
}
if [msg] =~ "AUTH_FAILED" {
mutate {
replace => { type => "openvpn_err" }
}
}
date {
match => ["timestamp", "MMM dd HH:mm:ss", "MMM d HH:mm:ss"]
target => "@timestamp"
}
if "_grokparsefailure" in [tags] {
drop { }
}
}
output {
# send to elasticsearch
elasticsearch {
cloud_id => "removed"
cloud_auth => "removed"
index => "openvpn-%{+YYYY.MM.dd}"
}
}
I am working with logstash 8.5.1 and elastic 8.5.0. I want to be able to push my logs to elasticsearch to save them for a longer period.