title: How can I check if my log's filepath contains a certain string in logstash config using regex?
body: <p>I'm using filebeat to send logs to logstash, based on their filename - these logs are sent to specific indexes in elasticsearch. 
  Filebeat works well, logstash receives the log files, but I can't seem to get the regex in my logstash config to check if the filenames contain a certain string working.</p>
  
  <p>Here's how my logstash config looks</p>
  
  <pre><code>input {
      beats {
        port =&gt; 5044
      }
  }
  filter {
      csv {
          separator =&gt; ","
          columns =&gt; ["Order ID","Status","Remarks"]
      }
  }
  output {
      if [source] =~ "/path/to/my/logs/log-file-1*.csv" {
          stdout {}
      }
      else if [source] =~ "/path/to/my/logs/log-file-2*.csv" {
          stdout {}
      }
      else if [source] =~ "/path/to/my/logs/log-file-3*.csv" {
          stdout {}
      }
      else if [source] =~ "/path/to/my/logs/log-file-4*.csv" {
          stdout {}
      }
  }
  </code></pre>
  
  <p>I've removed the part that sends to elasticsearch. I expect the output of data being printed to the stdout, but there isn't any.</p>
  
  <p>Am I referencing [source] the correct way?</p>