title: Logstash if field contains value
body: <p>I'm using Filebeat to forward logs into Logstash.
  I have filenames that contain "v2" in them, for an example:</p>
  
  <blockquote>
    <p>C:\logs\Engine\v2.latest.log</p>
  </blockquote>
  
  <p>I'd like to perform a different grok on these files.
  I tried both of the following:</p>
  
  <pre><code>filter{
     if "v2" in [filename] {
            grok {
              .....
              .....
            }
  
     }
   }
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>    filter{
             if [filename] =~ /v2/ {
                    grok {
                      .....
                      .....
                    }
  
             }
       }
  </code></pre>