title: Can someone explain the =~ operator in logstash?
body: <p>The following filter <strong>fails with</strong>: <em>The given configuration is invalid. Reason: Expected one of /, /, any character at line 23, column 1 (byte 308)</em> because there is a "/" missing at the end. It has to be <strong>/path/</strong>. Seems logstash interprets everything after /path as part of the regexp if not terminated with "/".</p>
  
  <pre><code>filter {
      if [message] =~ /path {
          drop { }
      }
  }
  </code></pre>
  
  <ol>
  <li>I know /path/ is a regexp, but what are the forward slashes for in this case? </li>
  <li>Will my pattern match any log line that has /path in it?</li>
  </ol>
  
  <p>Couldn't find anything in the <a href="https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html" rel="nofollow noreferrer">official docs</a> unfortunately.</p>