Syslog-ng
Syslog-ng is an open source implementation of syslog. You can use syslog-ng to monitor log files on your servers and forward them to InsightOps. We support two methods of forwarding rsyslog events to InsightOps, which are explained below. We recommend using our Token-based input method which brings additional security and is independent of the actual source IP address.
Token TCP
To add a new log into the InsightOps UI:
- Select Manual Configuration in Add data.
- Select Quick Add.
- Once you have created the log you will recieve a TOKEN UUID. It will be found under the form and beside the log name in the list of logs.
- Enter this token in the template section of the sample configuration.
- Change
REGION
to your set location.
Stating your Region
REGION
is the data center where your InsightOps account is located, for example eu
or us
.
- Copy the full configuration to your syslog-ng config file at
/etc/syslog-ng/syslog-ng.conf
1template InsightOpsFormat {2template("TOKEN_HERE $ISODATE $HOST $MSG\n"); template_escape(no);3};45source s_all {6internal();7unix-stream("/var/log/error.log");8};910destination d_network_logentries {11tcp("REGION.data.logs.insight.rapid7.com" port(80) template(InsightOpsFormat));12};1314log {15source(s_all); destination(d_network_logentries);16};
Secure Logging
To send your logs over SSL, configure your config as shown in this sample:
1template InsightOpsFormat {2template("TOKEN_HERE $ISODATE $HOST $MSG\n"); template_escape(no);3};4destination logentries {5network("REGION.data.logs.insight.rapid7.com" port(443) template(InsightOpsFormat) transport("tls") tls( ca-dir("/etc/ssl/certs/")));6};78log {9source(s_local); destination(d_network_logentries);10};
Plain TCP/UDP Forwarding
If you prefer a more basic syslog approach, we support Plain TCP/UDP Forwarding.
To add a new log in the InsightOps UI:
- Select Manual Configuration in Add a Log.
- Select Plain TCP/UDP.
- Locate your PORT number.
- Enter this PORT number in the
destination
section of the sample configuration. - Change
REGION
to your set location. - Copy the full configuration to your syslog-ng configuration file at
/etc/syslog-ng/etc/syslog-ng.conf
1source s_all {2internal();3unix-stream("/var/log/error.log");4};5destination d_logentries {6tcp("REGION.data.logs.insight.rapid7.com" port(PORT));7};8log {9source(s_all); destination(d_logentries);10};
Restart
To restart your syslog-ng server enter the command:
1sudo service syslog-ng restart
Required in Syslog-ng 3.0+ configuration file
Every syslog-ng configuration file must begin with a line containing the version information of syslog-ng. Here is an example of the opening line for syslog-ng version 3.6:
1@version: 3.6
Versioning the configuration file was introduced in syslog-ng 3.0. If the configuration file does not contain the version information, syslog-ng assumes that the file is for syslog-ng version 2.x. This interprets the configuration and sends warnings about the parts of the configuration that should be updated. Version 3.0 and later will correctly operate with configuration files of version 2.x, but the default values of certain parameters have changed since 3.0. Further information regarding this requirement may be found on the One Identity website: http://www.balabit.com/sites/default/files/documents/syslog-ng-ose-latest-guides/en/syslog-ng-ose-guide-admin/html-single/index.html