Syslog input plugin

  • Plugin version: v3.4.1
  • Released on: 2018-04-06
  • Changelog

For other versions, see theVersioned plugin docs.

Getting Help

For questions about the plugin, open a topic in the Discuss forums. For bugs or feature requests, open an issue in Github.For the list of Elastic supported plugins, please consult the Elastic Support Matrix.

Description

Read syslog messages as events over the network.

This input is a good choice if you already use syslog today.It is also a good choice if you want to receive logs fromappliances and network devices where you cannot run your ownlog collector.

Of course, syslog is a very muddy term. By default, this input onlysupports RFC3164 syslog with some small modifications. However, somenon-standard syslog formats can be read and parsed if a functionalgrok_pattern is provided. The date format is still only allowed to beRFC3164 style or ISO8601.

For more information see the RFC3164 page.

Note: This input will start listeners on both TCP and UDP.

Syslog Input Configuration Options

This plugin supports the following configuration options plus the Common Options described later.

Also see Common Options for a list of options supported by allinput plugins.

 

facility_labels

  • Value type is array
  • Default value is ["kernel", "user-level", "mail", "system", "security/authorization", "syslogd", "line printer", "network news", "UUCP", "clock", "security/authorization", "FTP", "NTP", "log audit", "log alert", "clock", "local0", "local1", "local2", "local3", "local4", "local5", "local6", "local7"]

Labels for facility levels. These are defined in RFC3164.

grok_pattern

  • Value type is string
  • Default value is "<%{POSINT:priority}>%{SYSLOGLINE}"

The default value should read and properly parse syslog lines which arefully compliant with RFC3164.

You can override this value to parse non-standard lines with a valid grokpattern which will parse the received lines. If the line is unable tobe parsed, the _grokparsefailure_sysloginput tag will be added.

The grok pattern must provide a timestamp field. If the timestampfield is omitted, or is unable to be parsed as RFC3164 style orISO8601, a _dateparsefailure tag will be added.

host

  • Value type is string
  • Default value is "0.0.0.0"

The address to listen on.

locale

  • Value type is string
  • There is no default value for this setting.

Specify a locale to be used for date parsing using either IETF-BCP47 or POSIX language tag.Simple examples are en,en-US for BCP47 or en_US for POSIX.If not specified, the platform default will be used.

The locale is mostly necessary to be set for parsing month names (pattern with MMM) andweekday names (pattern with EEE).

port

  • Value type is number
  • Default value is 514

The port to listen on. Remember that ports less than 1024 (privilegedports) may require root to use.

proxy_protocol

  • Value type is boolean
  • Default value is false

Proxy protocol support, only v1 is supported at this timehttp://www.haproxy.org/download/1.5/doc/proxy-protocol.txt

severity_labels

  • Value type is array
  • Default value is ["Emergency", "Alert", "Critical", "Error", "Warning", "Notice", "Informational", "Debug"]

Labels for severity levels. These are defined in RFC3164.

syslog_field

  • Value type is string
  • Default value is "message"

Codecs process the data before the rest of the data is parsed. Some codecs,like CEF, put the syslog data into another field after pre-processing thedata. Use this option in conjunction with the grok_pattern configurationto allow the syslog input plugin to fully parse the syslog data in this case.

input {  syslog {    port => 12345    codec => cef    syslog_field => "syslog"    grok_pattern => "<%{POSINT:priority}>%{SYSLOGTIMESTAMP:timestamp} CUSTOM GROK HERE"  }}

timezone

  • Value type is string
  • There is no default value for this setting.

Specify a time zone canonical ID to be used for date parsing.The valid IDs are listed on the [Joda.org available time zones page](http://joda-time.sourceforge.net/timezones.html).This is useful in case the time zone cannot be extracted from the value,and is not the platform default.If this is not specified the platform default will be used.Canonical ID is good as it takes care of daylight saving time for youFor example, America/Los_Angeles or Europe/France are valid IDs.

use_labels

  • Value type is boolean
  • Default value is true

Use label parsing for severity and facility levels.

Common Options

The following configuration options are supported by all input plugins:

Setting Input type Required

add_field

hash

No

codec

codec

No

enable_metric

boolean

No

id

string

No

tags

array

No

type

string

No

Details

 

add_field

  • Value type is hash
  • Default value is {}

Add a field to an event

codec

  • Value type is codec
  • Default value is "plain"

The codec used for input data. Input codecs are a convenient method for decoding your data before it enters the input, without needing a separate filter in your Logstash pipeline.

enable_metric

  • Value type is boolean
  • Default value is true

Disable or enable metric logging for this specific plugin instanceby default we record all the metrics we can, but you can disable metrics collectionfor a specific plugin.

id

  • Value type is string
  • There is no default value for this setting.

Add a unique ID to the plugin configuration. If no ID is specified, Logstash will generate one.It is strongly recommended to set this ID in your configuration. This is particularly usefulwhen you have two or more plugins of the same type, for example, if you have 2 syslog inputs.Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs.

input {  syslog {    id => "my_plugin_id"  }}

tags

  • Value type is array
  • There is no default value for this setting.

Add any number of arbitrary tags to your event.

This can help with processing later.

type

  • Value type is string
  • There is no default value for this setting.

Add a type field to all events handled by this input.

Types are used mainly for filter activation.

The type is stored as part of the event itself, so you canalso use the type to search for it in Kibana.

If you try to set a type on an event that already has one (forexample when you send an event from a shipper to an indexer) thena new input will not override the existing type. A type set atthe shipper stays with that event for its life evenwhen sent to another Logstash server.