title: logstash output to kafka - set partition key
body: <p>I am new to logstash.</p>
  
  <p>I am trying to read json data from files, and send it to kafka. the json i am reading contains keys for the topic, partition and the actual message. </p>
  
  <p>I cant find how to set the partition key.</p>
  
  <pre><code> input {
      file {
          path =&gt; "/data/files/*.*"
          start_position =&gt; "beginning"
          codec =&gt; "json"
      }
  }
  filter {
      json {
          source =&gt; message
      }
  }
  output {
      kafka { 
          bootstrap_servers =&gt; "localhost:9092"
          topic_id =&gt;  "%{topic}"
          message_key =&gt; "%{dataAsString}"
      }
  }
  </code></pre>
  
  <p>Help please...</p>
  
  <p>Regards, ido</p>