OpenVPN is a virtual private network system for secure point-to-point or site-to-site connections.
These instructions only apply to Linux and MacOS systems.
Before you begin, you’ll need:
- An active account with Layerlog
- OpenVPN Access Server installed
- Filebeat 7 installed on the same machine as OpenVPN Access Server
- Root priveleges on your machines
Download the Layerlog public certificate to your credentials server
For HTTPS shipping, download the Layerlog public certificate to your certificate authority folder.
sudo curl https://raw.githubusercontent.com/logzio/public-certificates/master/AAACertificateServices.crt --create-dirs -o /etc/pki/tls/certs/COMODORSADomainValidationSecureServerCA.crt
Configure Filebeat
Paste the following into the inputs section of the Filebeat configuration file:
filebeat.inputs:
- type: log
paths:
- /var/log/openvpnas.log
- /var/log/openvpnas.log.*
fields:
logzio_codec: json
# Your Layerlog account token. You can find your token at
# http://panel.layerlog.com/#/dashboard/settings/manage-accounts
token: <<LOG-SHIPPING-TOKEN>>
type: openvpn
fields_under_root: true
encoding: utf-8
ignore_older: 3h
multiline.type: pattern
multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\+[0-9]{4} \[\S+\]( {2,}| \})'
multiline.negate: false
multiline.match: after
filebeat.registry.path: /var/lib/filebeat
processors:
- rename:
fields:
- from: "agent"
to: "beat_agent"
ignore_missing: true
- rename:
fields:
- from: "log.file.path"
to: "source"
ignore_missing: true
output.logstash:
hosts: ["<<LISTENER-HOST>>:5015"]
ssl:
certificate_authorities: ['/etc/pki/tls/certs/COMODORSADomainValidationSecureServerCA.crt']
- Your Layerlog log shipping token directs the data securely to your Layerlog Log Management account. Manage your tokens.
- Use the listener URL specific to the region where your Layerlog account is hosted. Click to look up your listener URL.
Restart Filebeat to run it with the new configuration.
service filebeat restart
Check Layerlog for your logs
Give your logs some time to get from your system to ours, and then open Kibana. You can filter for data of type openvpn to see the incoming OpenVPN logs.
If you still don’t see your data, see log shipping troubleshooting.