title: Converting date format to YYYY-MM-DD from YYYY/MM/DD HH:MM:SS format in Logstash for nginx error logs
body: <p>I am having nginx error logs  of the below form:-</p>
  
  <blockquote>
    <p>2015/09/30 22:19:38 [error] 32317#0: *23 [lua] responses.lua:61:
    handler(): Cassandra error: Error during UNIQUE check: Cassandra
    error: connection refused, client: 127.0.0.1, server: , request: "POST
    /consumers/ HTTP/1.1", host: "localhost:8001"</p>
  </blockquote>
  
  <p>As mentioned <a href="https://logstash.jira.com/browse/LOGSTASH-1663?focusedCommentId=20224&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-20224" rel="noreferrer">here</a> I am able to parse this logs. </p>
  
  <p>My filter configuration is like the below:-</p>
  
  <pre><code>filter {  
    grok {
        match =&gt; {
          "message" =&gt; [
            "%{DATESTAMP:mydate} \[%{DATA:severity}\] (%{NUMBER:pid:int}#%{NUMBER}: \*%{NUMBER}|\*%{NUMBER}) %{GREEDYDATA:mymessage}",
            "%{DATESTAMP:mydate} \[%{DATA:severity}\] %{GREEDYDATA:mymessage}",
            "%{DATESTAMP:mydate} %{GREEDYDATA:mymessage}"
          ]
        }
        add_tag =&gt; ["nginx_error_pattern"]
      }
  
      if ("nginx_error_pattern" in [tags]) {      
        grok {
          match =&gt; {
            "mymessage" =&gt; [
              "server: %{DATA:[request_server]},"
            ]
          }        
        }
  
        grok {
          match =&gt; {
            "mymessage" =&gt; [
              "host: \"%{IPORHOST:[request_host]}:%{NUMBER:[port]}\""
            ]
          }        
        }
  
        grok {
          match =&gt; {
            "mymessage" =&gt; [
              "request: \"%{WORD:[request_method]} %{DATA:[request_uri]} HTTP/%{NUMBER:[request_version]:float}\""
            ]
          }        
        }
  
        grok {
          match =&gt; {
            "mymessage" =&gt; [
              "client: %{IPORHOST:[clientip]}",
              "client %{IP:[clientip]} "
            ]
          }        
        }
  
        grok {
          match =&gt; {
            "mymessage" =&gt; [
              "referrer: \"%{DATA:[request_referrer]}\""
            ]
          }       
        }                
      }
  }
  </code></pre>
  
  <p><code>mydate</code> is having date of the form:-</p>
  
  <pre><code>"mydate" =&gt; "15/09/30 22:19:38"
  </code></pre>
  
  <p>Can someone let me know how can I add one more field (let's say <code>log_day</code>) having date of the form <code>2015-09-30</code>?</p>