Split filepath to a new field

Is this you looking for?

    mutate { add_field => { "devicename" => "%{[log][file][path]}" } }
    mutate{ gsub => ["devicename", '/var/log/remote/', "" ] }
    mutate{ gsub => ["devicename", '[/]', "" ] }

Also is possible by grok