# Run Filebeat as either service in UNIX or Background Job

**URL:** <https://discuss.elastic.co/t/run-filebeat-as-either-service-in-unix-or-background-job/93314>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [July 16, 2017, 9:07pm UTC](https://discuss.elastic.co/t/run-filebeat-as-either-service-in-unix-or-background-job/93314 "2017-07-16T21:07:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laker99](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@Laker99](https://discuss.elastic.co/u/Laker99)\
**Post date:** [July 16, 2017, 9:07pm UTC](https://discuss.elastic.co/t/run-filebeat-as-either-service-in-unix-or-background-job/93314/1 "2017-07-16T21:07:41Z")

</div>

Hello All,

Good day 🙂 Hope you're doing fine. May I please take a few minutes of your time?

Q. How can I start Filebeat in background mode?  
Here's what I'm dealing with,  
filebeat installed in /home//filebeat  
I can start filebeat in background from the console using - "nohup /home//filebeat/filebeat -c filebeat.yml &"

The problem?  
The server gets rebooted every so often and I am forced to start it manually ?  
Is there any way we can automate filebeat start?

Problems I'm facing,

1. If within a .sh script, I execute - "/home//filebeat/filebeat -c filebeat.yml &", I get the error - "error in initing prospector: missing field accessing 'filebeat.prospectors.0.path.0' and filebeat does not start
2. Can I install it as a service, just like in Windows? If so, how?

Hope I have stated my problem(s) to everyone's understanding. If you have any questions, please let me know.

Thank you in advance for your time and cooperation 🙂

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 16, 2017, 11:07pm UTC](https://discuss.elastic.co/t/run-filebeat-as-either-service-in-unix-or-background-job/93314/2 "2017-07-16T23:07:43Z")

</div>

Why not install it via a package, then it comes with the service scripts.

---

<div class="post-metadata">

**Author:** ![Laker99](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@Laker99](https://discuss.elastic.co/u/Laker99)\
**Post date:** [July 17, 2017, 4:03pm UTC](https://discuss.elastic.co/t/run-filebeat-as-either-service-in-unix-or-background-job/93314/3 "2017-07-17T16:03:33Z")

</div>

Hello Mark! Thanks for your response 🙂

However, here are my issues,

1. The UNIX server I'm running Filebeat on is behind firewalls and does not have access to the outside Internet  
So, I'm unable to download any package  
I ran into the same problems when installing plugins for Logstash, so I had to download it as a .zip files on Windows and unzip them onto UNIX

Is it possible to download the service scripts for Filebeat for UNIX independently? Also, how do these work? Can you please explain briefly?

Thanks again for your time and cooperation 🙂

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 17, 2017, 9:04pm UTC](https://discuss.elastic.co/t/run-filebeat-as-either-service-in-unix-or-background-job/93314/4 "2017-07-17T21:04:26Z")

</div>

Why don't you just download the deb/rpm instead of the zip then?

---

<div class="post-metadata">

**Author:** ![Laker99](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@Laker99](https://discuss.elastic.co/u/Laker99)\
**Post date:** [July 17, 2017, 11:57pm UTC](https://discuss.elastic.co/t/run-filebeat-as-either-service-in-unix-or-background-job/93314/5 "2017-07-17T23:57:08Z")

</div>

Hello Mark! Good day!

I was able to get around this... I wrote a shell script to start filebeat in background mode (filebeat -c filebeat.yml &) and invoke the shell script inside an autopilot configuration. One of our 3rd party S/W has an autopilot setup, where I was able to add the shell script to their .conf file.

I tried downloading the rpm/deb files, but was unable to figure out how the service works.

I really appreciate all your time and cooperation 🙂 If you can tell me how and where to download the scripts to install and run filebeat as a service, whenever you get a chance, that'd be great.

Take care and wish you the very best.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 17, 2017, 11:59pm UTC](https://discuss.elastic.co/t/run-filebeat-as-either-service-in-unix-or-background-job/93314/6 "2017-07-17T23:59:09Z")

</div>

If you downloaded the deb/rpm then you can install it and it automatically deploys the relevant service file for you.

---

<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 14, 2017, 11:59pm UTC](https://discuss.elastic.co/t/run-filebeat-as-either-service-in-unix-or-background-job/93314/7 "2017-08-14T23:59:13Z")

</div>

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