Hello
This is my json:
{"serial_number":"36307","time":"2017-11-20 08:10:40.340 +03:00","transaciton_id":"","card_hash":"","component":"READER","level":"DEBUG","message":"Request": SrvOpen: SrvOpenRequest: {"TgComName":"/dev/oti"}"}
I need translate my field serial_number according with my yml file.
krotov@test:~$ cat /etc/logstash/dict.yml
"36322": It worked!
So. How i can translate this field?
My config:
input {
tcp {
port => 5044
host => '0.0.0.0'
}
}
filter {
date {
match => [ "timestamp" , "dd/MMM/YYYY:HH:mm:ss Z" ]
remove_field => [ "timestamp" ]
}
json {
source => "message"
target => "css"
remove_field => "message"
add_field => {"sn" => "%{serial_number}" } ###- this not work. in kibana saw sn: %{serial_number}. ###
}
translate {
field => "serial_number"
destination => "translate"
dictionary_path => "/etc/logstash/dict.yml"
override => "true"
}
}
output {
elasticsearch {
hosts => "127.0.0.1:9200"
index => "mgt"
codec => rubydebug
document_type => "%{[@metadata][type]}"
}
Pls help with this. Sorry for bad language