Introduction
Syslog-ng, a flexible and scalable log management solution, can integrate seamlessly with OpsRamp for efficient log collection and monitoring. This integration supports two primary methods: Agent-based and Direct forwarding.
- Agent-Based Integration: With agent-based integration, Syslog-ng forwards logs to OpsRamp through an installed agent. The agent collects syslog-ng logs and transmits them securely to OpsRamp, where they are processed for monitoring, alerting, and analysis.
- Direct: Syslog-ng can directly forward logs to OpsRamp without requiring an intermediary agent. This method is beneficial for environments where direct communication is preferred or where agent deployment may be impractical.
Configuration
Below is the default configuration for integrating Syslog-ng with OpsRamp in an agent-based setup:
Note
Supported in agent version 13.1 and above.Syslog-ng configuration
- To forward logs using syslog-ng, add the following configuration to your
/etc/syslog-ng/syslog-ng.conf
file. - The following configuration specifies that all traffic coming in on port 515 should be forwarded to the OpsRamp agent, which is listening on port 514.
- The source of the input can vary depending on the use case, but to export logs to the OpsRamp portal, the destination must be configured as shown below:
- Execute the following command in the terminal to restart Syslog-NG:
Note
The Syslog-NG configuration shown here is generic. If you need to forward logs for only a specific host, please refer to the official Syslog-NG documentation.Custom Configuration
- Create a custom configuration file at
/opt/opsramp/agent/conf/log.d/log-config.yaml
by copying the content from the sample config file/opt/opsramp/agent/conf/log.d/log-config.yaml.sample
. - Update (add/edit/remove) the configurations as needed for the
syslog_server
source, using the guidelines for field definitions provided below:
- Save the updated configuration file at
/opt/opsramp/agent/conf/log.d/log-config.yaml
. - Restart the agent by executing the following command in the terminal:
Supported labels
Following are some of the supported labels:
- source
- resourceUUID
Configuration
To transmit logs from syslog-ng to OpsRamp, set up a new HTTP destination and utilize it to forward logs from the necessary sources in syslog-ng.
Note
The following steps use the default configuration path: /etc/syslog-ng. You can make the necessary changes if your installation uses a different configuration file path.- Create a new configuration file. It is suggested to generate a new configuration file in the conf.d directory within the syslog-ng configuration folder.
touch /etc/syslog-ng/conf.d/10-opsramp.conf
- Add the below content to
/etc/syslog-ng/conf.d/10-opsramp.conf
file created in Step 1.
The destination configuration above includes the HTTP endpoint for exporting logs, necessary headers, and default batching options for transmitting logs to OpsRamp.
Note
- For additional configuration details regarding the HTTP destination, refer to the syslog-ng Open Source Edition 3.30 - Administration Guide.
- Set the Content-Type header to application/syslog.rfc5424 for the configuration to work properly.
- OpsRamp only supports request sizes up to 1MB, therefore, batch-bytes must always be configured to a value less than 1MB.
/etc/syslog-ng/conf.d/10-opsramp.conf
file after the destination is configured. The source configuration is named s_src
as shown below:- Restart the syslog-ng service using the following command:
Supported labels
Supported labels refer to the specific identifiers or attributes that can be associated with log messages in syslog-ng. These labels provide additional context or metadata about the log messages, helping to search, sort, and process log messages efficiently.
Following are some of the supported labels:
- source
- host
- level
- facility
- severity