Running Filebeat in windows

ScipioAfricanus picture ScipioAfricanus · Jan 19, 2017 · Viewed 26.6k times · Source

I set up filebeat on windows recently using these instructions

https://www.elastic.co/downloads/beats/filebeat

but it forces me to keep a cmd prompt open running the command

filebeat.exe -c filebeat.yml

I am wondering if there is a way to run this as a background process?

Thanks.

Answer

A J picture A J · Jan 20, 2017

Try walking through the full Getting Started guide for Filebeat. There are instructions for Windows. Basically the instructions are:

  1. Extract the download file anywhere.

  2. Move the extracted directory into Program Files.

    PS > mv filebeat-5.1.2-windows-x86_64 "C:\Program Files\Filebeat"
    
  3. Install the filebeat service.

    PS > cd "C:\Program Files\Filebeat"
    PS C:\Program Files\Filebeat> powershell.exe -ExecutionPolicy UnRestricted -File .\install-service-filebeat.ps1
    
  4. Edit the filebeat.yml config file and test your config.

    PS C:\Program Files\Filebeat> .\filebeat.exe -e test config
    
  5. (Optional) Run Filebeat in the foreground to make sure everything is working correctly. Ctrl+C to exit.

    PS C:\Program Files\Filebeat> .\filebeat.exe -c filebeat.yml -e -d "*"
    
  6. Start the service.

    PS > Start-Service filebeat
    

And if you need to stop it, use Stop-Service filebeat. You might need to stop it and start it if you want to make changes to the config.