title: logstash kafka input multiple topics with different codecs
body: <p>this is my logstash conf</p>
  
  <pre><code>input {
    kafka {
      bootstrap_servers =&gt; "127.0.0.1:9092"
      topics =&gt; ["filebeat", "access"]
      group_id =&gt; "test-consumer-group"
      consumer_threads =&gt; 1
      decorate_events =&gt; true
    }
  }
  </code></pre>
  
  <p>I have two topics but I want to use different codec for diffrent topic. how can I do this?</p>
  
  <p>I try to add </p>
  
  <pre><code>    if ([topic] == "filebeat") {
        codec =&gt; "json"
      }
  </code></pre>
  
  <p>in the kafka input conf, the the logstash returns me errors.</p>
  
  <pre><code>Failed to execute action {:action=&gt;LogStash::PipelineAction::Create/pipeline_id:main, :exception=&gt;"LogStash::ConfigurationError", :message=&gt;"Expected one of #, =&gt; at line 6, column 8 (byte 143) after input {\n  kafka {\n    bootstrap_servers =&gt; \"127.0.0.1:9092\"\n    topics =&gt; [\"filebeat\", \"access\"]\n    group_id =&gt; \"test-consumer-group\"\n    if "
  </code></pre>