json编解码

时间:2021-10-26 15:49:26
[elk@zjtest7-frontend test]$ cat json.conf
input {
stdin {
}
} filter {
json{
source =>"message"
target =>"jsonconnect"
}
} output {
stdout {
codec=>rubydebug{}
}
} [elk@zjtest7-frontend test]$ ../../bin/logstash -f json.conf
Settings: Default pipeline workers: 1
Pipeline main started
{"uid":1111,"type":2222}
{
"message" => "{\"uid\":1111,\"type\":2222}",
"@version" => "1",
"@timestamp" => "2016-09-13T03:08:43.567Z",
"host" => "0.0.0.0",
"jsonconnect" => {
"uid" => 1111,
"type" => 2222
}
}