Hi all, I have a folder which contains two different types of CSV files. My logstash config is as below. When I run logstash, it just ingests the csvs as is without the columns getting generated. If I explicitly mention the file, then it works. I reckon the problem is in the if condition as it doesn't match. Really appreciate if someone could point the issue here. Thank you!
input {
  file {
    path => "/opt/out/Vol/*.csv"
    start_position => "beginning"
    sincedb_path => "/dev/null"
  }
}
filter {
if [path] =~ "/opt/out/Vol/*pslist.PsList.csv"
{
  csv {
      separator => ","
      skip_header => "true"
      columns => ["TreeDepth","PID","PPID","ImageFileName","Offset(V)","Threads","Handles","SessionId","Wow64","CreateTime","ExitTime","File output"]
  }
  }
else if [path] =~ "/opt/out/Vol/*cmdline.CmdLine.csv"
{
  csv {
      separator => ","
      skip_header => "true"
      columns => ["TreeDepth","PID","Process","Args"]
  }
}
}
output {
   elasticsearch {
     hosts => "http://localhost:9200"
     index => "vol"
  }
stdout {}
}