# Logstash (Running as Windows Service) - cannot obtain logs from Windows Network Drive

**URL:** https://discuss.elastic.co/t/logstash-running-as-windows-service-cannot-obtain-logs-from-windows-network-drive/288290
**Category:** Logstash
**Created:** [November 3, 2021, 7:23am UTC](https://discuss.elastic.co/t/logstash-running-as-windows-service-cannot-obtain-logs-from-windows-network-drive/288290 "2021-11-03T07:23:55Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![coldycc](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@coldycc](https://discuss.elastic.co/u/coldycc)
#### Post date: [November 3, 2021, 7:23am UTC](https://discuss.elastic.co/t/logstash-running-as-windows-service-cannot-obtain-logs-from-windows-network-drive/288290/1 "2021-11-03T07:23:55Z")

</div>

Hi Everyone,

I'm having issue to get Logstash to send logs from Windows network drive while running it as Windows Service (using NSSM), it works perfectly fine using the CLI.

Here's the logstash.conf:

```auto
input {
  file {
   path => "c:/sample.log"
   path => "c:/networklog/sample.log"
   path => "//sample-test-winvm-002/networkdrive/location1/sample.log"
# path => "//10.0.0.22/networkdrive/location1/sample.log"
# path => "z:/location1/sample.log"
  }
}

```

From the debug logs, I can see the following messages in a loop when I append test log message to my log file in the remote network drive:

````auto
[2021-11-03T07:03:15,137][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=>"ParNew"}
[2021-11-03T07:03:15,138][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=>"ConcurrentMarkSweep"}
[2021-11-03T07:03:15,266][DEBUG][logstash.instrument.periodicpoller.cgroup] One or more required cgroup files or directories not found: /proc/self/cgroup, /sys/fs/cgroup/cpuacct, /sys/fs/cgroup/cpu
[2021-11-03T07:03:16,446][DEBUG][logstash.pipeline] Pushing flush onto pipeline {:pipeline_id=>"main", :thread=>"#<Thread:0x3b16e697 sleep>"}
[2021-11-03T07:03:20,152][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=>"ParNew"}
[2021-11-03T07:03:20,154][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=>"ConcurrentMarkSweep"}
[2021-11-03T07:03:20,280][DEBUG][logstash.instrument.periodicpoller.cgroup] One or more required cgroup files or directories not found: /proc/self/cgroup, /sys/fs/cgroup/cpuacct,```

~~
In short, tried the following but still has no clue:

1. Mapped the network drive - no go;
2. Netlink - no go;
3. Tried both v6.7 and v7.11.x - no go;

Did I overlooked anything? Any help would be much appreciated.

Thanks,
````

---

<div class="post-metadata">

### Author: ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)
#### Post date: [November 3, 2021, 7:34am UTC](https://discuss.elastic.co/t/logstash-running-as-windows-service-cannot-obtain-logs-from-windows-network-drive/288290/2 "2021-11-03T07:34:37Z")

</div>

Is the same user running CLI and service?  
Maybe your files were read, perhaps to delete the file registry database (sincedb\_path).

---

<div class="post-metadata">

### Author: ![coldycc](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@coldycc](https://discuss.elastic.co/u/coldycc)
#### Post date: [November 3, 2021, 12:26pm UTC](https://discuss.elastic.co/t/logstash-running-as-windows-service-cannot-obtain-logs-from-windows-network-drive/288290/3 "2021-11-03T12:26:37Z")

</div>

Hi Rios, thanks for the help, in short using the same user for both cli and windows.service.

Let me delete sinceDB file, finger-crossed. Just want to double check is my conf file syntax is correct. Thanks

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [November 3, 2021, 4:12pm UTC](https://discuss.elastic.co/t/logstash-running-as-windows-service-cannot-obtain-logs-from-windows-network-drive/288290/4 "2021-11-03T16:12:08Z")

</div>

If the file input is not reading the file as you expect it to then enable log.level TRACE. The filewatch module will then log messages about what it is doing.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [December 1, 2021, 4:12pm UTC](https://discuss.elastic.co/t/logstash-running-as-windows-service-cannot-obtain-logs-from-windows-network-drive/288290/5 "2021-12-01T16:12:45Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
