Central Log Service (CLS) for OS X
Introduction
- These instructions are specific to our environment
- Messages, system, install and Filebeat logs will be sent
- If you have other services to log, contact CLS for details and a custom template
- Prerequisites: Terminal, vi or plain text editor, administrative account with root access
Instructions
Installing Beats
- Open Terminal and switch to root
sudo su -
- Download filebeat with this command:
sudo curl -L -O curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.4.1-darwin-x86_64.tar.gz tar xzvf filebeat-8.4.1-darwin-x86_64.tar.gz
- Rename the new directory and move it to /Applications/Utilities with this command:
sudo mv filebeat-8.4.1-darwin-x86_64 /Applications/Utilities/filebeat/
- Delete the compressed filebeat:
sudo rm filebeat-8.4.1-darwin-x86_64.tar.gz
- Using a web browser, download this certificate and copy to the /Applications/Utilities/filebeat folder:
- incommon_tls_chain.pem (from www.pki.vt.edu)
Configuring Beats
- Download and copy this config file (filebeat.yml) into Applications/Utilities/filebeat, replacing the existing file
- Open the filebeat.yml file you downloaded from /Applications/Utilities/filebeat/ with a plain text editor or vi
- In the Filebeat Inputs filestream section, edit the following:
- id: my-filestream-id - replace my-filestream-id with a name of your choice such as "endpoint filestream" or "web server filestream"
- in the Filebeat inputs fields section, edit the values for the following fields:
- tier: "tier" - replace with tier: "prod", tier: "dev", tier: "pprd" or tier: "endpoint" as appropriate
- name: "service name" - replace "service name" with a name of your choice that describes what the device does, such as "Mac laptop" or "Apache web server"
- service_id: "edu.vt.org.service.name" - replace with an id of your choice that describes your service, such as service_id: "edu.vt.hokies.webserver" or "edu.vt.hokies.workstation"
- host: "host-name" - replace "host-name" with a short version of the device's name or its Fully Qualified Domain Name, such as host: "HOKIES-JDOE-MBP" or host: "webserver1.hokies.vt.edu"
- index: "vt_logstash" - replace "vt_logstash" with the index name that was created in your consultation with CLS
- Save and close filebeat.yml
- Set root as the owner for these files:
- sudo chown root /Applications/Utilities/filebeat/filebeat.yml
- sudo chown root /Applications/Utilities/filebeat/module/system/syslog/manifest.yml
- sudo chown root /Applications/Utilities/filebeat/modules.d/system.yml
- sudo chown root /Applications/Utilities/filebeat/module/system/auth/manifest.yml
Testing Beats
- In the Terminal in the /Applications/Utilities/filebeat directory
- Check the configuration file is syntactically correct with this command:
sudo /Applications/Utilities/filebeat/filebeat -c /Applications/Utilities/filebeat/filebeat.yml test config
- Terminal should return "Config OK." Otherwise, correct errors and test again
Starting Beats
- In the Terminal in the /Applications/Utilities/filebeat directory
- Enable the system module to run:
sudo ./filebeat modules enable system
- Start the daemon:
sudo ./filebeat -e -c filebeat.yml
Next steps
- If you have questions or would like to schedule an introduction to Splunk via Zoom, please open a ticket mentioning CLS and we'd be glad to help
- You can also reach us on #central_monitoring and #central_log on VT Slack