# How can i run data collect automatically without using command "logstrash -f" after restarting OS

**URL:** <https://discuss.elastic.co/t/how-can-i-run-data-collect-automatically-without-using-command-logstrash-f-after-restarting-os/192003>\
**Category:** Logstash\
**Created:** [July 24, 2019, 10:12am UTC](https://discuss.elastic.co/t/how-can-i-run-data-collect-automatically-without-using-command-logstrash-f-after-restarting-os/192003 "2019-07-24T10:12:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumar4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumar4/32/48326_2.png) [@kumar4](https://discuss.elastic.co/u/kumar4)\
**Post date:** [July 24, 2019, 10:12am UTC](https://discuss.elastic.co/t/how-can-i-run-data-collect-automatically-without-using-command-logstrash-f-after-restarting-os/192003/1 "2019-07-24T10:12:12Z")

</div>

i have many conf file to collect data from different sources, and after a shutdown or restart of the machien i am obliged to run the command "logstash -f test.conf", I want to automate this task and launch it automatically when starting the system how can i do that

---

<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:** [July 24, 2019, 11:51am UTC](https://discuss.elastic.co/t/how-can-i-run-data-collect-automatically-without-using-command-logstrash-f-after-restarting-os/192003/2 "2019-07-24T11:51:15Z")

</div>

Use a [service wrapper](https://en.wikipedia.org/wiki/Service_wrapper). On UNIX that would be init, systemd, or whatever is native to your platform. On Windows you have many options including NSSM.

---

<div class="post-metadata">

**Author:** ![kumar4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumar4/32/48326_2.png) [@kumar4](https://discuss.elastic.co/u/kumar4)\
**Post date:** [July 24, 2019, 2:58pm UTC](https://discuss.elastic.co/t/how-can-i-run-data-collect-automatically-without-using-command-logstrash-f-after-restarting-os/192003/3 "2019-07-24T14:58:00Z")

</div>

i am using ubuntu i see some people putting .conf file in /etc/logstash/conf.d , is that a good solution

---

<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:** [July 24, 2019, 3:06pm UTC](https://discuss.elastic.co/t/how-can-i-run-data-collect-automatically-without-using-command-logstrash-f-after-restarting-os/192003/4 "2019-07-24T15:06:05Z")

</div>

I do not run Ubuntu. The native service manager is [version dependent](https://linoxide.com/linux-how-to/enable-disable-services-ubuntu-systemd-upstart/).

It is possible that during installation logstash created a logstash service and you just need to

```
sudo systemctl enable logstash
sudo systemctl start logstash
```

---

<div class="post-metadata">

**Author:** ![kumar4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumar4/32/48326_2.png) [@kumar4](https://discuss.elastic.co/u/kumar4)\
**Post date:** [July 24, 2019, 3:08pm UTC](https://discuss.elastic.co/t/how-can-i-run-data-collect-automatically-without-using-command-logstrash-f-after-restarting-os/192003/5 "2019-07-24T15:08:43Z")

</div>

yes iknow that but my probelem is not runining logstash at the start of os but run the collect automatically without using "logstash -f input.conf", i want to put the \*conf file somewhere to make the collect automatic even if the os is restarted

---

<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:** [July 24, 2019, 3:55pm UTC](https://discuss.elastic.co/t/how-can-i-run-data-collect-automatically-without-using-command-logstrash-f-after-restarting-os/192003/6 "2019-07-24T15:55:32Z")

</div>

Point path.config in logstash.yml to that file.

---

<div class="post-metadata">

**Author:** ![kumar4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumar4/32/48326_2.png) [@kumar4](https://discuss.elastic.co/u/kumar4)\
**Post date:** [July 25, 2019, 9:54am UTC](https://discuss.elastic.co/t/how-can-i-run-data-collect-automatically-without-using-command-logstrash-f-after-restarting-os/192003/7 "2019-07-25T09:54:34Z")

</div>

> [@Badger](#):
>
> path.config in logstash.yml

please can you give ana example of this line; can i specify multiple input.conf in path.config in logstash.yml file.  
thank you very much

---

<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:** [July 25, 2019, 1:54pm UTC](https://discuss.elastic.co/t/how-can-i-run-data-collect-automatically-without-using-command-logstrash-f-after-restarting-os/192003/8 "2019-07-25T13:54:44Z")

</div>

I believe you can specify a path that includes wildcards, so that would allow multiple files.

---

<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:** [August 22, 2019, 2:03pm UTC](https://discuss.elastic.co/t/how-can-i-run-data-collect-automatically-without-using-command-logstrash-f-after-restarting-os/192003/9 "2019-08-22T14:03:05Z")

</div>

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