title: Logstash write hash line by line to csv
body: <p>I have a file which contains multiple JSON lines. I am able to transform them into the below structure.</p>
  <pre><code>{
              &quot;@version&quot; =&gt; &quot;1&quot;,
                   &quot;key&quot; =&gt; &quot;my_key&quot;,
             &quot;host_name&quot; =&gt; &quot;machine1&quot;,
            &quot;@timestamp&quot; =&gt; 2020-08-03T09:21:11.014Z,
      &quot;epoch_value_pair&quot; =&gt; {
          &quot;1596175350&quot; =&gt; &quot;4&quot;,
          &quot;1596178945&quot; =&gt; &quot;5&quot;,
          &quot;1596178920&quot; =&gt; &quot;4&quot;,
          &quot;1596175380&quot; =&gt; &quot;4&quot;,
          &quot;1596178975&quot; =&gt; &quot;7&quot;,
          &quot;1596175365&quot; =&gt; &quot;4&quot;,
          &quot;1596175335&quot; =&gt; &quot;4&quot;
      },
                  &quot;host&quot; =&gt; &quot;host machine&quot;
  }
  </code></pre>
  <p>Now how do I convert this into a csv file with [&quot;host_name&quot;, &quot;key&quot;, &quot;epoch&quot;, &quot;value&quot;]?</p>
  <p>Expected output is:</p>
  <p>host_name,key,epoch,value</p>
  <p>machine1,my_key,1596175350,4</p>
  <p>machine1,my_key,1596178945,5</p>
  <p>machine1,my_key,1596178920,4</p>
  <p>CSV output plugin is not helping. Can someone please help?</p>