Logstash + Split filepath with backslash \

Hello All,

I am facing a issue to split the filepath with backslash,

Below is my code for split filepath with \

Logstash Code

input {

file {
path => "C:\logstash-2.3.1\CSV\SQL.csv"
type=>"sql"
}

}

filter {
mutate {
split => [ "path", '\' ]
}

}

Thanks for your help in advance,

I can't explain why, but impossible to say split filter to use \ as separator...
You can open an issue on github : https://github.com/logstash-plugins/logstash-filter-split/issues

Anyway, here's a tricky configuration to make it work :

  mutate {
    gsub => ["path", "[\\]", "/"]
  }

  mutate {
    split => { "path" => "/" }
  }
1 Like