json编解码

[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
    }
}

原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199213.html