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

posted @ 2016-09-13 11:12  czcb  阅读(164)  评论(0编辑  收藏  举报