# Logstash from command line works, but not from service?

**URL:** <https://discuss.elastic.co/t/logstash-from-command-line-works-but-not-from-service/213234>\
**Category:** Logstash\
**Created:** [December 27, 2019, 10:33pm UTC](https://discuss.elastic.co/t/logstash-from-command-line-works-but-not-from-service/213234 "2019-12-27T22:33:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dris](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@dris](https://discuss.elastic.co/u/dris)\
**Post date:** [December 27, 2019, 10:33pm UTC](https://discuss.elastic.co/t/logstash-from-command-line-works-but-not-from-service/213234/1 "2019-12-27T22:33:44Z")

</div>

So, I have a conf file for checking a mysql DB and adding new records. It works great when I run it via the terminal (bin/logstash -f \<file.conf\>) but when I move the .conf in the conf.d folder, it never runs.

I check the logs, it says the pipeline started, but never actually does any requests.  
my config:  
input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:mysql://mydb.com/dbname"  
jdbc\_user =\> "user"  
jdbc\_password =\> "pwd"  
jdbc\_driver\_library =\> "/root/mysql-connector-java-8.0.18/mysql-connector-java-8.0.18.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
# our query  
statement =\> "SELECT \* FROM table WHERE id \> :sql\_last\_value"  
use\_column\_value =\> true  
tracking\_column =\> id  
jdbc\_paging\_enabled =\> "true"  
jdbc\_page\_size =\> "5000"  
schedule =\> "\* \* \* \* \*"  
}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "db-%{+yyyy-MM-dd}"  
}  
}

---

<div class="post-metadata">

**Author:** ![dris](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@dris](https://discuss.elastic.co/u/dris)\
**Post date:** [December 28, 2019, 11:21am UTC](https://discuss.elastic.co/t/logstash-from-command-line-works-but-not-from-service/213234/2 "2019-12-28T11:21:50Z")

</div>

reporting back in case someone else runs into the same issue. Logstash as a service runs on its own user, which doesnt have access to root's folder. There was no permission denied messages either, so a bit trickier to debug. All resolved now.

---

<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:** [January 25, 2020, 11:21am UTC](https://discuss.elastic.co/t/logstash-from-command-line-works-but-not-from-service/213234/3 "2020-01-25T11:21:57Z")

</div>

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