title: How to output logs to different Kafka topics under different keywords?
body: <p>Here is my Logstash input log file:</p>
  
  <pre><code>{"timestamp":"2019-10-18T16:37:53.137068+0800","flow_id":1072393101531249,"in_iface":"eno1","event_type":"event A"}
  {"timestamp":"2019-10-18T16:37:53.137069+0800","flow_id":1072393101531249,"in_iface":"eno1","event_type":"event B"}
  </code></pre>
  
  <p>Now I want to output these logs to different kafka topics(<code>topic.A</code> and <code>topic.B</code>) based on different <code>event_type</code>.
  Here is my current Logstash configuration:</p>
  
  <pre><code>input {
    file {
      path =&gt; "/data/*.json"
    }
  }
  filter {
  
  }
  output {
    kafka {
      codec =&gt; plain {
        format =&gt; "%{message}"
      }
      topic_id =&gt; "topic.A"
      ...
    }
  }
  </code></pre>
  
  <p>How can I do what I want in logstash filter and output?</p>