立即与支持人员聊天
与支持团队交流

syslog-ng Premium Edition 7.0.34 - Administration Guide

Preface Introduction to syslog-ng The concepts of syslog-ng Installing syslog-ng PE The syslog-ng PE quick-start guide The syslog-ng PE configuration file Collecting log messages — sources and source drivers
How sources work default-network-drivers: Receive and parse common syslog messages internal: Collecting internal messages file: Collecting messages from text files google-pubsub: collecting messages from the Google Pub/Sub messaging service wildcard-file: Collecting messages from multiple text files linux-audit: Collecting messages from Linux audit logs mssql, oracle, sql: collecting messages from an SQL database network: Collecting messages using the RFC3164 protocol (network() driver) office365: Fetching logs from Office 365 osquery: Collect and parse osquery result logs pipe: Collecting messages from named pipes program: Receiving messages from external applications python: writing server-style Python sources python-fetcher: writing fetcher-style Python sources snmptrap: Read Net-SNMP traps syslog: Collecting messages using the IETF syslog protocol (syslog() driver) system: Collecting the system-specific log messages of a platform systemd-journal: Collecting messages from the systemd-journal system log storage systemd-syslog: Collecting systemd messages using a socket tcp, tcp6,udp, udp6: Collecting messages from remote hosts using the BSD syslog protocol udp-balancer: Receiving UDP messages at very high rate unix-stream, unix-dgram: Collecting messages from UNIX domain sockets windowsevent: Collecting Windows event logs
Sending and storing log messages — destinations and destination drivers
elasticsearch2>: Sending messages directly to Elasticsearch version 2.0 or higher (DEPRECATED) elasticsearch-http: Sending messages to Elasticsearch HTTP Event Collector file: Storing messages in plain-text files google_bigquery(): Sending logs to a Google BigQuery table google_bigquery_managedaccount(): Sending logs to a Google BigQuery table authenticated by Google Cloud managed service account google_pubsub(): Sending logs to the Google Cloud Pub/Sub messaging service google_pubsub-managedaccount(): Sending logs to the Google Cloud Pub/Sub messaging service authenticated by Google Cloud managed service account hdfs: Storing messages on the Hadoop Distributed File System (HDFS) http: Posting messages over HTTP kafka(): Publishing messages to Apache Kafka (Java implementation) (DEPRECATED) kafka-c(): Publishing messages to Apache Kafka using the librdkafka client (C implementation) logstore: Storing messages in encrypted files mongodb: Storing messages in a MongoDB database network: Sending messages to a remote log server using the RFC3164 protocol (network() driver) pipe: Sending messages to named pipes program: Sending messages to external applications python: writing custom Python destinations sentinel(): Sending logs to the Microsoft Azure Sentinel cloud snmp: Sending SNMP traps smtp: Generating SMTP messages (email) from logs splunk-hec: Sending messages to Splunk HTTP Event Collector sql(): Storing messages in an SQL database stackdriver: Sending logs to the Google Stackdriver cloud syslog: Sending messages to a remote logserver using the IETF-syslog protocol syslog-ng(): Forward logs to another syslog-ng node tcp, tcp6, udp, udp6: Sending messages to a remote log server using the legacy BSD-syslog protocol (tcp(), udp() drivers) unix-stream, unix-dgram: Sending messages to UNIX domain sockets usertty: Sending messages to a user terminal — usertty() destination Client-side failover
Routing messages: log paths, flags, and filters Global options of syslog-ng PE TLS-encrypted message transfer Advanced Log Transport Protocol Reliability and minimizing the loss of log messages Manipulating messages parser: Parse and segment structured messages Processing message content with a pattern database Correlating log messages Enriching log messages with external data Monitoring statistics and metrics of syslog-ng Multithreading and scaling in syslog-ng PE Troubleshooting syslog-ng Best practices and examples The syslog-ng manual pages Glossary

sentinel(): Sending logs to the Microsoft Azure Sentinel cloud

Microsoft Azure Sentinel is Microsoft's native cloud based SIEM solution. Beside Microsoft's own cloud services, it can accept log messages from external sources. Microsoft provides 26 predefined Data connectors and a HTTP Data Collector API for further integrations. Using this public HTTP REST interface, syslog-ng Premium Edition (syslog-ng PE) can ingest log messages directly to Microsoft Azure Sentinel cloud using the http() destination driver.

For more information about Microsoft Azure Sentinel, see Microsoft Azure: Azure Sentinel documentation.

For more information about Data connectors used in Microsoft Azure Sentinel, see Microsoft Azure: Connect data sources.

Caution:

Hazard of data loss!

The sentinel() destination's fields() parameter is optional and has the following default values:

fields("Computer=$HOST HostName=$HOST ProcessID=$PID SyslogMessage=$MSGHDR$MSG Facility=$FACILITY SeverityLevel=$LEVEL HostIP=$SOURCEIP EventTime=$S_ISODATE")

Although it is possible to customize these default values, an incorrect configuration may result in log loss. Therefore, One Identity recommends that you do not customize the default values of the fields() parameter unless you know exactly what you are doing.

Limitations

The current implementation of the sentinel() destination has the following limitations:

  • Only the PUT and the POST methods are supported.

  • HTTPS connections, as well as password-based and certificate-based authentication, are supported.

  • If the server returns a status code beginning with 4 (for example, 404) to the POST or PUT request, syslog-ng PE drops the message without attempting to resend it.

NOTE: Typically, only the central syslog-ng PE server uses this destination. For more information on the server mode, see Server mode.

Declaration
destination d_sentinel {
    sentinel(
        workspace-id("<MS provided Workspace ID / UUID>")
        auth-secret("<MS provided Shared key / Secret>")
    );
}

Configuring the sentinel() destination to send logs to the Microsoft Azure Sentinel cloud

Starting with version 7.0.19, syslog-ng Premium Edition (syslog-ng PE) can ingest log messages directly to Microsoft Azure Sentinel by using Microsoft Azure Sentinel's public HTTP Data Collector API interface.

The syslog-ng PE application can directly post log messages to the Microsoft Azure Sentinel cloud using the http() destination driver.

Prerequisites

To configure syslog-ng PE to forward messages to Microsoft Azure Sentinel, you must have an active Microsoft Azure Sentinel Workspace. For more information, see Microsoft Azure Sentinel: Quickstart: On-board Azure Sentinel.

Getting the required credentials to configure syslog-ng PE as a Data Connector for Microsoft Azure Sentinel

While configuring your Microsoft Azure Sentinel Workspace according to the Microsoft Azure Sentinel: Quickstart: On-board Azure Sentinel guide's Connect data sources section, you will find certain credentials of the selected Microsoft Azure Sentinel Workspace (namely, WORKSPACE ID and PRIMARY KEY) that you should make a note of. The WORKSPACE ID and PRIMARY KEY credentials are required so that syslog-ng PE can authenticate to Microsoft servers.

To gather the required credentials to configure syslog-ng PE as a Data connector for Microsoft Azure Sentinel,

  1. Log in to your Microsoft Azure Sentinel account, then navigate to Dashboard > Azure Sentinel workspaces.

  2. Select the workspace you want to use, then under the selected workspace, select Data Connectors.

  3. Select Syslog from the list of connectors.

    A new panel will open on the right.

  4. Select Open connector page from the new panel on the right.

  5. Navigate back to Dashboard > Azure Sentinel workspaces > Azure Sentinel - Data connectors > Syslog.

  6. Under Instructions, select Open your workspace advanced settings configuration.

  7. Navigate to Dashboard > Azure Sentinel - Data connectors > Syslog > Advanced settings.

  8. Copy the following information from Connected Sources > Linux Servers:

    • WORKSPACE ID

      In the syslog-ng PE configuration, this will function as the workspace-id parameter.

    • PRIMARY KEY

      In the syslog-ng PE configuration, this will function as the auth-secret parameter.

Example: Using Azure Sentinel credentials in the sentinel() destination

In your syslog-ng PE configuration, you can use the credentials you have gathered like this:

d_sentinel {
    sentinel(
        workspace-id("01234567-89ab-cdef-0123-456789abcdef") // Provided by Microsoft: unique hexadecimal number, identifying your Sentinel instance.
        auth-secret("MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWYwMTIzNDU2Nzg5YWJjZGVmMDEyMzQ1Njc4OWFiY2RlZgo=") // Provided by Microsoft: Base64-encoded secret, identifying your application.
 
        # optional
        log-type("Syslog_CL")
    );
};

Caution:

Hazard of data loss!

The sentinel() destination's fields() parameter is optional and has the following default values:

fields("Computer=$HOST HostName=$HOST ProcessID=$PID SyslogMessage=$MSGHDR$MSG Facility=$FACILITY SeverityLevel=$LEVEL HostIP=$SOURCEIP EventTime=$S_ISODATE")

Although it is possible to customize these default values, an incorrect configuration may result in log loss. Therefore, One Identity recommends that you do not customize the default values of the fields() parameter unless you know exactly what you are doing.

Log types

On the Microsoft Azure Sentinel user interface, you can filter log events by referring to log-type parameters. Although the log-type parameters query information with their custom query language (namely, Kusto), they are essentially table fields in a database.

For more information about log-type parameters, see Microsoft Azure: Write data to Log Analytics repository.

For more information about the Kusto query language, see Microsoft Azure: Query Language: Overview.

The log-type parameter is mandatory for the Microsoft Azure Sentinel HTTP Data Collector API interface, and for syslog-ng Premium Edition (syslog-ng PE), its default value is Syslog_CL.

NOTE: While Microsoft Azure Sentinel accepts log events from external sources, it also has built-in log types. To differentiate external and built-in log types, Azure Sentinel automatically applies the Custom Log-type (_CL) suffix to log events that originate from external sources. Although the log-type parameter is optional (unlike workspace-id and auth-secret, which are mandatory), keep in mind that Microsoft Azure Sentinel will automatically attach the _CL suffix to all log events originating from external sources. For example, log events that originate from syslog-ng PE will be named Syslog_CL by default.

NOTE: If you want to store messages in different log types that all connect to the same workspace-id, you can create multiple sentinel() destinations that have a common workspace-id, but different log-type parameters.

Example syslog-ng PE message

When forwarding messages to Microsoft Azure Sentinel, syslog-ng PE automatically populates the following fields:

{
    "SyslogMessage": "<34>Oct 11 22:14:15 sentineluser prog1: message_begin 2020-02-10 08:29:02:329951-default message_end\n",
    "SeverityLevel": "notice",
    "ProcessID": "",
    "HostName": "myhost",
    "HostIP": "127.0.0.1",
    "Facility": "user",
    "EventTime": "2020-02-10T09:29:48+01:00",
    "Computer": "ubuntu"
}
相关文档

The document was helpful.

选择评级

I easily found the information I needed.

选择评级