Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed input from syslog to tcp/udp due to unsupported RFC #18447

Merged
merged 3 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions filebeat/docs/modules/fortinet.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,26 @@ include::../include/config-option-intro.asciidoc[]
----
- module: fortinet
firewall:
var.syslog_host: 0.0.0.0
var.syslog_port: 9004
enabled: true
var.input: udp
var.host: 0.0.0.0
var.port: 9004
----

include::../include/var-paths.asciidoc[]

*`var.syslog_host`*::
*`var.input`*::

The interface to listen to UDP based syslog traffic. Defaults to localhost.
The protocol to use, can be either the value `tcp` or `udp`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about mentioning file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you manually check the udp input with a netcat message?

I tested with both TCP and UDP. TCP works with the same amount of messages and 0 error.messages filled, UDP also works but I see a few GROK missmatch messages (with the same logs). This seems to be because it sends the whole 300 messages at the same time, and all messages that gets through gets parsed correctly, while the other few gets a grok error message.

Any idea here? Testing seems fine, and If I tested with a smaller set of logs it should still work fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some new testing, UDP is also fine.


*`var.host`*::

The interface to listen to all syslog traffic. Defaults to localhost.
Set to 0.0.0.0 to bind to all available interfaces.

*`var.syslog_port`*::
*`var.port`*::

The UDP port to listen for syslog traffic. Defaults to 9004.
The port to listen for syslog traffic. Defaults to 9004.

[float]
==== Fortinet ECS fields
Expand Down
18 changes: 12 additions & 6 deletions x-pack/filebeat/module/fortinet/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,26 @@ include::../include/config-option-intro.asciidoc[]
----
- module: fortinet
firewall:
var.syslog_host: 0.0.0.0
var.syslog_port: 9004
enabled: true
var.input: udp
var.host: 0.0.0.0
var.port: 9004
----

include::../include/var-paths.asciidoc[]

*`var.syslog_host`*::
*`var.input`*::

The interface to listen to UDP based syslog traffic. Defaults to localhost.
The protocol to use, can be either the value `tcp` or `udp`.

*`var.host`*::

The interface to listen to all syslog traffic. Defaults to localhost.
Set to 0.0.0.0 to bind to all available interfaces.

*`var.syslog_port`*::
*`var.port`*::

The UDP port to listen for syslog traffic. Defaults to 9004.
The port to listen for syslog traffic. Defaults to 9004.

[float]
==== Fortinet ECS fields
Expand Down
13 changes: 9 additions & 4 deletions x-pack/filebeat/module/fortinet/firewall/config/firewall.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{{ if eq .input "syslog" }}
{{ if eq .input "tcp" }}

type: syslog
protocol.udp:
host: "{{.syslog_host}}:{{.syslog_port}}"
type: tcp
host: "{{.host}}:{{.port}}"

{{ else if eq .input "udp" }}

type: udp
host: "{{.host}}:{{.port}}"

{{ else if eq .input "file" }}

Expand All @@ -11,6 +15,7 @@ paths:
{{ range $i, $path := .paths }}
- {{$path}}
{{ end }}

exclude_files: [".gz$"]

{{ end }}
Expand Down
3 changes: 3 additions & 0 deletions x-pack/filebeat/module/fortinet/firewall/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ processors:
- remove:
field: fortinet.firewall.transip
if: "ctx.fortinet?.firewall?.transip == 'N/A'"
- remove:
field: fortinet.firewall.tunnelip
if: "ctx.fortinet?.firewall?.tunnelip == 'N/A'"
- remove:
field:
- _temp
Expand Down
6 changes: 3 additions & 3 deletions x-pack/filebeat/module/fortinet/firewall/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module_version: 1.0

var:
- name: syslog_host
- name: host
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might still want to call this variables syslog_host and syslog_port to stay aligned with the rest of the modules. The underlying protocol is still syslog (more or less), right?

default: localhost
- name: tags
default: [fortinet-firewall]
- name: syslog_port
- name: port
default: 9004
- name: input
default: syslog
default: udp

ingest_pipeline:
- ingest/pipeline.yml
Expand Down