LOGSTASH-过滤器JSON

LOGSTASH-过滤器JSON,logstash,logstash-grok,Logstash,Logstash Grok,我只需要在卡夫卡主题中保存ship节点的内容,不幸的是,我已经执行了几个测试,并且过滤器不工作 我的json与此类似 { "_index": "abd", "type" : "doc", "_source":{ "response_body": { "ship":[ { "type" :

我只需要在卡夫卡主题中保存ship节点的内容,不幸的是,我已经执行了几个测试,并且过滤器不工作

我的json与此类似

 {
  "_index": "abd",
  "type" : "doc",
  "_source":{
  "response_body": {
      "ship":[
    {
      "type"  : "iPhone",
      "number": "0123-4567-8888"
    },
     {
      "type"  : "iPhone",
      "number": "0123-4567-4444"
    }
            ]
  }}}
我的日志存储配置如下

input {

  file {
     path => "${PWD}/logstash_input"
     start_position => "beginning"
     sincedb_path => "/dev/null"
     type => "json"
   }
}

filter{
    json{
        source => "message"
        target => "_source.response_body"
    }

}
output {
  kafka {
    bootstrap_servers => "localhost:9092"
    codec => json{}
    topic_id =>  "testtopic"
  }

示例JSON是来自elasticsearch的文档,还是logstash正在接收的文档?@Texugo我需要使用elasticsearch文档示例JSON是来自elasticsearch的文档,还是logstash正在接收的文档?@Texugo我需要使用elasticsearch文档