# Config works if I run logstash on it, but not when run as logstash service

**URL:** <https://discuss.elastic.co/t/config-works-if-i-run-logstash-on-it-but-not-when-run-as-logstash-service/53469>\
**Category:** Logstash\
**Created:** [June 21, 2016, 9:05am UTC](https://discuss.elastic.co/t/config-works-if-i-run-logstash-on-it-but-not-when-run-as-logstash-service/53469 "2016-06-21T09:05:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![timogoosen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timogoosen/32/29750_2.png) [@timogoosen](https://discuss.elastic.co/u/timogoosen)\
**Post date:** [June 21, 2016, 9:05am UTC](https://discuss.elastic.co/t/config-works-if-i-run-logstash-on-it-but-not-when-run-as-logstash-service/53469/1 "2016-06-21T09:05:49Z")

</div>

Hi guys. I have a config that works if I run logstash on the config individually like this:

```
$ /opt/logstash/bin/logstash -f someconfig.conf
```

Or if I run it as root for that matter, but if I run the logstash as a service on Ubuntu and I place my config in the directory where the other configs are located which on my box is

```
/etc/logstash/conf.d/
```

then the config just shows grokparsefailure and does not contain much or any data.

If I run this:

```
$ /opt/logstash/bin/logstash -f insert-config-name-here.conf --configtest
```

on each config individually then everything seems fine, I get the output:

```
Configuration OK
```

after running the command on each config. If I run this: (Then I get an error):

```
# service logstash configtest
```

The part of the config that I've changed since the last time when everything worked fine is this part(Perhaps it helps if I post this here too):

Take note I removed some parts for my own privacy reasons. Thanks for your time.

```
output {
  elasticsearch {
...

  }
  if [type] == "WindowsLog" {
    elasticsearch {
      hosts => "localhost"
...
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 4, 2016, 6:56pm UTC](https://discuss.elastic.co/t/config-works-if-i-run-logstash-on-it-but-not-when-run-as-logstash-service/53469/2 "2016-07-04T18:56:56Z")

</div>

> after running the command on each config. If I run this: (Then I get an error):

What error do you get?

---

<div class="post-metadata">

**Author:** ![timogoosen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timogoosen/32/29750_2.png) [@timogoosen](https://discuss.elastic.co/u/timogoosen)\
**Post date:** [July 25, 2016, 9:46am UTC](https://discuss.elastic.co/t/config-works-if-i-run-logstash-on-it-but-not-when-run-as-logstash-service/53469/3 "2016-07-25T09:46:55Z")

</div>

Nevermind I got it working by running with more worker threads.  
Thanks for your reply though.

---

<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:** [July 6, 2017, 4:46am UTC](https://discuss.elastic.co/t/config-works-if-i-run-logstash-on-it-but-not-when-run-as-logstash-service/53469/4 "2017-07-06T04:46:36Z")

</div>


