title: Create a new index per day for Elasticsearch in Logstash configuration
body: <p>I intend to have an ELK stack setup where daily JSON inputs get stored in log files created, one for each date. My logstash shall listen to the input via these logs and store it to Elasticsearch at an index corresponding to the date of the log file entry. </p>
  
  <p>My <code>logstash-output.conf</code> goes something like:</p>
  
  <pre><code>output {
    elasticsearch { 
      host =&gt; localhost
      cluster =&gt; "elasticsearch_prod"
      index =&gt; "test"
    }
  }
  </code></pre>
  
  <p>Thus, as for now, all the inputs to logstash get stored at index <code>test</code> of elasticsearch. What I want is that an entry to logstash occurring on say, 2015.11.19, which gets stored in logfile named <code>logstash-2015.11.19.log</code>, must be correspondingly stored at an index <code>test-2015.11.19</code>. </p>
  
  <p>How should I edit my logstash configuration file to enable this ?</p>