I have the filebeat running on Freebsd and started the filebeat service via "service filebeat onestart" however I want to run filebeat service automatically in case service has stopped or if the server is rebooted, etc. Filebeat should run all the time. I know we can use "nohup" or cron script, just want to know if any other options.
This sounds more like a FreeBSD than Filebeat question and I'll start by admitting that I'm not very familiar with FreeBSD. However, it sounds like what you're looking for is https://www.freebsd.org/doc/handbook/configtuning-rcd.html, specifically the part about adding your service to /etc/rc.conf, so something like:
I don't think this is a Filebeat-specific concern. I think you'd be better served by asking this question on a FreeBSD forum, since there might be idiomatic ways of doing this for FreeBSD that you'd want to apply to Filebeat but also any other services.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.