logstash-plugins/logstash-input-file

Specifying a UNC-Path (windows network share) for the path-setting does not work

s137 opened this issue · 0 comments

s137 commented

Logstash information:

Please include the following information:

  1. Logstash version: 8.4.3
  2. Logstash installation source: extracted from the official zip archive
  3. How is Logstash being run: windows service
  4. How was the Logstash Plugin installed: plugin was not installed seperately

JVM (e.g. java -version): Bundled JDK: OpenJDK 64-Bit Server VM 17.0.4+8 on 17.0.4+8 +indy +jit [x86_64-mswin32]

OS version (uname -a if on a Unix-like system): Windows 10

Description of the problem including expected versus actual behavior:

Specifying a UNC-Path (windows network share) for the "path"-Setting of the logstash file input plugin doesn't work. In most of the cases the pipeline just starts and does nothing, in a few cases an error is thrown, that absolute paths are not allowed, which makes sense, but I wanted to try anyway

Here's what I've tried so far:

path => ["\PC-NAME\share\file.txt"]
path => ["\\PC-NAME\share\file.txt"]
path => ["\\\\PC-NAME\\share\\file.txt"]
path => ["PC-NAME\share\file.txt"]
path => ["PC-NAME/share/file.txt"]
path => ["/PC-NAME/share/file.txt"]
path => ["//PC-NAME/share/file.txt"]
path => ["////PC-NAME//share//file.txt"]
path => ["file://///PC-NAME/share/file.txt"]

The last one works on windows also in the browser for example.

Steps to reproduce:

Just specify a UNC-Path in the path-setting of the file-input plugin with an empty filter and output to elasticsearch or stdout to check if it reads the file. It works perfetly for local paths like this: C:/share/file.txt but not for UNC-Paths.

see also here: https://discuss.elastic.co/t/how-to-specify-an-unc-path-network-share-for-logstash-file-input-plugin/316900)