Hello elastic community,
I have a problem with one of my Logstash parsing configurations.
One customer want to use a country field. The information to fill the country field I can extract from the path, but I don't know exactly how to do this. All my tries weren't successfull to realize it.
my Code look like:
input {
file {
path => [ "/was/log//1/mip/vn/1/server.log" ]
type => "serverlog"
codec => multiline {
pattern => "^%{TIME}"
negate => true
what => previous
}
}
}
filter {
if [type] == "serverlog" {
mutate {
add_field => { "stage" => "PROD" }
}
grok {
match => [ "message", "%{TIME:log_timestamp} %{DATA:log_level}%{SPACE}\[%{DATA:loggername}\] \(%{DATA:log_info}\)%{SPACE}%{GREEDYDATA:message}" ]
match => [ "path", "/was/log/1/mip/%{DATA:Country}/%{GREEDYDATA}" ]
overwrite => [ "message" ]
}
mutate {
uppercase => [ "Country" ]
}
}
}
I expected by using this configuration, that the Country field will be filled, but this do not work.
I hope that somebody have an idea how I can realize the customers request.
Greetz