title: logstash changing ordering of json input to elastic search
body: <p>I have a logstash process running which is consuming data from a kafka topic. Messages in kafka topic are already in json format. logstash is simply pushing them in elastic search. But while doing so logstash changes ordering of the fields. There is a team which is consuming csv format of the data, so the changed ordering gives them trouble. What could be the reason?</p>
  
  <p>for e.g input json {"foo1":"bar1","foo2":"bar2"}. logstash pushes it in elastic then in elastic it looks like {"foo2":"bar2","foo1":"bar1"}</p>
  
  <p>logstash config</p>
  
  <pre><code>input{
      kafka{
          codec=&gt;'json' bootstrap_servers =&gt; [localhost:9092] topics =&gt;  'sample-logs' auto_offset_reset =&gt; 'earliest' =&gt; group_id =&gt; 'logstash-consumer'
      }
  }
  output {
       elasticsearch { 
           hosts =&gt; "localhost:9200", codec =&gt; json index=&gt; "sample-logs-es" } 
  stdout { 
      codec =&gt; rubydebug 
  }
  </code></pre>