-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Syslog inputs parses RFC3164 events via TCP or UDP (#6842)
The Syslog inputs will use the UDP and TCP source lib, allowing the same socket behavior and the same options as the two existing inputs. The parser is a state machine build with ragel[1] and allow to parse FC3164[2] events with some less than perfect variants, if the received event is a complete RFC3164 we will extract all of them, for us the minimum valid message MUST have the `date` and the `message` defined. Anything else we will log and drop them. Fields: * priority * timestamp * program * pid * message * facility: extracted from the priority * severity: extracted from the priority * severity_label: mapped from the official list. * facility_label: mapped from the official list[2] Sample Configuration: ```yaml #enabled: false #protocol.tcp: # The host and port to receive the new event #host: "localhost:9000" # Character used to split new message #line_delimiter: "\n" # Maximum size in bytes of the message received over TCP #max_message_size: 20MiB # The number of seconds of inactivity before a remote connection is closed. #timeout: 300s #protocol.udp: # The host and port to receive the new event #host: "localhost:9000" # Maximum size of the message received over UDP #max_message_size: 10240 ``` Limitations: * Doesn't support multiline events like darwin can do, we need to extract the multiline logic from the log input. * Only support RFC3164, RFC5424 will require more work on the parser. close #5862 [1]: http://www.colm.net/open-source/ragel/ [2]: https://tools.ietf.org/html/rfc3164
- Loading branch information
Showing
33 changed files
with
3,195 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
////////////////////////////////////////////////////////////////////////// | ||
//// This content is shared by Filebeat inputs that use the TCP inputsource | ||
//// If you add IDs to sections, make sure you use attributes to create | ||
//// unique IDs for each input that includes this file. Use the format: | ||
//// [id="{beatname_lc}-input-{type}-option-name"] | ||
////////////////////////////////////////////////////////////////////////// | ||
[float] | ||
[id="{beatname_lc}-input-{type}-tcp-max-message-size"] | ||
==== `max_message_size` | ||
|
||
The maximum size of the message received over TCP. The default is `20MiB`. | ||
|
||
[float] | ||
[id="{beatname_lc}-input-{type}-tcp-host"] | ||
==== `host` | ||
|
||
The host and TCP port to listen on for event streams. | ||
|
||
[float] | ||
[id="{beatname_lc}-input-{type}-tcp-line-delimiter"] | ||
==== `line_delimiter` | ||
|
||
Specify the characters used to split the incoming events. The default is '\n'. | ||
|
||
[float] | ||
[id="{beatname_lc}-input-{type}-tcp-timeout"] | ||
==== `timeout` | ||
|
||
The number of seconds of inactivity before a remote connection is closed. The default is `300s`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
////////////////////////////////////////////////////////////////////////// | ||
//// This content is shared by Filebeat inputs that use the UDP inputsource | ||
//// If you add IDs to sections, make sure you use attributes to create | ||
//// unique IDs for each input that includes this file. Use the format: | ||
//// [id="{beatname_lc}-input-{type}-option-name"] | ||
////////////////////////////////////////////////////////////////////////// | ||
[float] | ||
[id="{beatname_lc}-input-{type}-udp-max-message-size"] | ||
==== `max_message_size` | ||
|
||
The maximum size of the message received over UDP. The default is `10KiB`. | ||
|
||
[float] | ||
[id="{beatname_lc}-input-{type}-udp-host"] | ||
==== `host` | ||
|
||
The host and UDP port to listen on for event streams. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
:type: syslog | ||
|
||
[id="{beatname_lc}-input-{type}"] | ||
=== Syslog input | ||
|
||
++++ | ||
<titleabbrev>Syslog</titleabbrev> | ||
++++ | ||
|
||
Use the `syslog` input to read events over TCP or UDP, this input will parse BSD (rfc3164) | ||
event and some variant. | ||
|
||
Example configurations: | ||
|
||
["source","yaml",subs="attributes"] | ||
---- | ||
{beatname_lc}.inputs: | ||
- type: syslog | ||
protocol.udp: | ||
host: "localhost:9000" | ||
---- | ||
|
||
["source","yaml",subs="attributes"] | ||
---- | ||
{beatname_lc}.inputs: | ||
- type: syslog | ||
protocol.tcp: | ||
host: "localhost:9000" | ||
---- | ||
|
||
==== Configuration options | ||
|
||
The `syslog` input supports protocol specific configuration options plus the | ||
<<{beatname_lc}-input-{type}-common-options>> described later. | ||
|
||
Protocol `udp`: | ||
|
||
include::../inputs/input-common-udp-options.asciidoc[] | ||
|
||
Protocol `tcp`: | ||
|
||
include::../inputs/input-common-tcp-options.asciidoc[] | ||
|
||
[id="{beatname_lc}-input-{type}-common-options"] | ||
include::../inputs/input-common-options.asciidoc[] | ||
|
||
:type!: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.