Logstash 1.4 filter not working


#1

I am running logstash 1.4.0 and I try to rename site_name with domaine_name using the filter but it is not changing the file
I am not sure what I am doing wrong. Please help

input {
file {
path => "/var/data/logstash/url-topic.log"
start_position => beginning
sincedb_path => "/var/data/logstash"

}

}

filter {
if [path] == "/var/data/logstash/url-topic.log" {
mutate {
rename => { "site_name" => "domaine_name" }
}
}
}

output {
file {
path => "/var/data/logstash/url-output-%{+YYYY-MM-dd}.txt"
}
}

File looks like this:
{"message":"{"url":"www.somesite.com/something/workout/","site_name":"www.somesite.com","@timestamp":"2016-01-16T04:14:11.003+0000....etc....


(Magnus B├Ąck) #2

You need to set the codec for the file plugins to "json" (or "json_lines"?) so that the JSON text in the input is deserialized properly (so that you can access the fields) and so that it's serialized back to JSON upon output.


#3

Thanks


(system) #4