Skip to content

Commit

Permalink
Add ZooKeeper Module to Filebeat (#25128)
Browse files Browse the repository at this point in the history
Adds a new module for ZooKeeper audit and service logs.
  • Loading branch information
legoguy1000 authored Apr 28, 2021
1 parent 89d2b36 commit d09dfb0
Show file tree
Hide file tree
Showing 24 changed files with 1,954 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add `awsfargate` module to collect container logs from Amazon ECS on Fargate. {pull}25041[25041]
- New module `cyberarkpas` for CyberArk Privileged Access Security audit logs. {pull}24803[24803]
- Add `uri_parts` processor to Apache, Nginx, IIS, Traefik, S3Access, Cisco, F5, Fortinet, Google Workspace, Imperva, Microsoft, Netscout, O365, Sophos, Squid, Suricata, Zeek, Zia, Zoom, and ZScaler modules ingest pipelines. {issue}19088[19088] {pull}24699[24699]
- New module `zookeeper` for Zookeeper service and audit logs {issue}25061[25061] {pull}25128[25128]

*Heartbeat*

Expand Down
87 changes: 87 additions & 0 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ grouped in the following categories:
* <<exported-fields-tomcat>>
* <<exported-fields-traefik>>
* <<exported-fields-zeek>>
* <<exported-fields-zookeeper>>
* <<exported-fields-zoom>>
* <<exported-fields-zscaler>>

Expand Down Expand Up @@ -164031,6 +164032,92 @@ type: boolean

--

[[exported-fields-zookeeper]]
== ZooKeeper fields

ZooKeeper Module



[float]
=== zookeeper




[float]
=== audit

ZooKeeper Audit logs.



*`zookeeper.audit.session`*::
+
--
Client session id


type: keyword

--

*`zookeeper.audit.znode`*::
+
--
Path of the znode


type: keyword

--

*`zookeeper.audit.znode_type`*::
+
--
Type of znode in case of creation operation


type: keyword

--

*`zookeeper.audit.acl`*::
+
--
String representation of znode ACL like cdrwa(create, delete,read, write, admin). This is logged only for setAcl operation


type: keyword

--

*`zookeeper.audit.result`*::
+
--
Result of the operation. Possible values are (success/failure/invoked). Result "invoked" is used for serverStop operation because stop is logged before ensuring that server actually stopped.


type: keyword

--

*`zookeeper.audit.user`*::
+
--
Comma separated list of users who are associate with a client session


type: keyword

--

[float]
=== log

ZooKeeper logs.


[[exported-fields-zoom]]
== Zoom fields

Expand Down
93 changes: 93 additions & 0 deletions filebeat/docs/modules/zookeeper.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
////
This file is generated! See scripts/docs_collector.py
////

[[filebeat-module-zookeeper]]
:modulename: zookeeper
:has-dashboards: false

== ZooKeeper module

The +{modulename}+ module collects and parses the logs created by https://zookeeper.apache.org/[Apache ZooKeeper]

include::../include/what-happens.asciidoc[]

include::../include/gs-link.asciidoc[]

[float]
=== Compatibility

The +{modulename}+ module was tested with logs from versions 3.7.0.

include::../include/configuring-intro.asciidoc[]

The following example shows how to set paths in the +modules.d/{modulename}.yml+
file to override the default paths for logs:

[source,yaml]
-----
- module: zookeeper
audit:
enabled: true
var.paths:
- "/path/to/logs/zookeeper_audit.log*"
log:
enabled: true
var.paths:
- "/path/to/logs/zookeeper.log*"
-----


To specify the same settings at the command line, you use:

[source,yaml]
-----
-M "zookeeper.audit.var.paths=[/path/to/logs/zookeeper_audit.log*]" -M "zookeeper.log.var.paths=[/path/to/logs/zookeeper.log*]"
-----

[float]
=== Audit logging

Audit logging is available since Zookeeper 3.6.0, but it is disabled by default. To enable it, you can add the following setting to the configuration file:
["source","sh"]
----------------------
audit.enable=true
----------------------

//set the fileset name used in the included example
:fileset_ex: audit

include::../include/config-option-intro.asciidoc[]

[float]
==== `audit` fileset settings

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

include::../include/timezone-support.asciidoc[]

:fileset_ex!:

//set the fileset name used in the included example
:fileset_ex: log

include::../include/config-option-intro.asciidoc[]

[float]
==== `log` fileset settings

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

include::../include/timezone-support.asciidoc[]

:fileset_ex!:

:modulename!:


[float]
=== Fields

For a description of each field in the module, see the
<<exported-fields-zookeeper,exported fields>> section.

2 changes: 2 additions & 0 deletions filebeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ This file is generated! See scripts/docs_collector.py
* <<filebeat-module-tomcat>>
* <<filebeat-module-traefik>>
* <<filebeat-module-zeek>>
* <<filebeat-module-zookeeper>>
* <<filebeat-module-zoom>>
* <<filebeat-module-zscaler>>

Expand Down Expand Up @@ -144,5 +145,6 @@ include::modules/threatintel.asciidoc[]
include::modules/tomcat.asciidoc[]
include::modules/traefik.asciidoc[]
include::modules/zeek.asciidoc[]
include::modules/zookeeper.asciidoc[]
include::modules/zoom.asciidoc[]
include::modules/zscaler.asciidoc[]
17 changes: 17 additions & 0 deletions x-pack/filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2365,6 +2365,23 @@ filebeat.modules:
# Filebeat will choose the paths depending on your OS.
#var.paths:

#------------------------------ ZooKeeper Module ------------------------------
- module: zookeeper
# All logs
audit:
enabled: true

# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
#var.paths:
# All logs
log:
enabled: true

# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
#var.paths:

#--------------------------------- Zoom Module ---------------------------------
- module: zoom
webhook:
Expand Down
1 change: 1 addition & 0 deletions x-pack/filebeat/include/list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions x-pack/filebeat/module/zookeeper/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- module: zookeeper
# All logs
audit:
enabled: true

# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
#var.paths:
# All logs
log:
enabled: true

# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
#var.paths:
80 changes: 80 additions & 0 deletions x-pack/filebeat/module/zookeeper/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
:modulename: zookeeper
:has-dashboards: false

== ZooKeeper module

The +{modulename}+ module collects and parses the logs created by https://zookeeper.apache.org/[Apache ZooKeeper]

include::../include/what-happens.asciidoc[]

include::../include/gs-link.asciidoc[]

[float]
=== Compatibility

The +{modulename}+ module was tested with logs from versions 3.7.0.

include::../include/configuring-intro.asciidoc[]

The following example shows how to set paths in the +modules.d/{modulename}.yml+
file to override the default paths for logs:

[source,yaml]
-----
- module: zookeeper
audit:
enabled: true
var.paths:
- "/path/to/logs/zookeeper_audit.log*"
log:
enabled: true
var.paths:
- "/path/to/logs/zookeeper.log*"
-----


To specify the same settings at the command line, you use:

[source,yaml]
-----
-M "zookeeper.audit.var.paths=[/path/to/logs/zookeeper_audit.log*]" -M "zookeeper.log.var.paths=[/path/to/logs/zookeeper.log*]"
-----

[float]
=== Audit logging

Audit logging is available since Zookeeper 3.6.0, but it is disabled by default. To enable it, you can add the following setting to the configuration file:
["source","sh"]
----------------------
audit.enable=true
----------------------

//set the fileset name used in the included example
:fileset_ex: audit

include::../include/config-option-intro.asciidoc[]

[float]
==== `audit` fileset settings

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

include::../include/timezone-support.asciidoc[]

:fileset_ex!:

//set the fileset name used in the included example
:fileset_ex: log

include::../include/config-option-intro.asciidoc[]

[float]
==== `log` fileset settings

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

include::../include/timezone-support.asciidoc[]

:fileset_ex!:

:modulename!:
10 changes: 10 additions & 0 deletions x-pack/filebeat/module/zookeeper/_meta/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- key: zookeeper
title: "ZooKeeper"
release: beta
description: >
ZooKeeper Module
fields:
- name: zookeeper
type: group
description: >
fields:
30 changes: 30 additions & 0 deletions x-pack/filebeat/module/zookeeper/audit/_meta/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
- name: audit
type: group
description: >
ZooKeeper Audit logs.
release: beta
fields:
- name: session
type: keyword
description: >
Client session id
- name: znode
type: keyword
description: >
Path of the znode
- name: znode_type
type: keyword
description: >
Type of znode in case of creation operation
- name: acl
type: keyword
description: >
String representation of znode ACL like cdrwa(create, delete,read, write, admin). This is logged only for setAcl operation
- name: result
type: keyword
description: >
Result of the operation. Possible values are (success/failure/invoked). Result "invoked" is used for serverStop operation because stop is logged before ensuring that server actually stopped.
- name: user
type: keyword
description: >
Comma separated list of users who are associate with a client session
Loading

0 comments on commit d09dfb0

Please sign in to comment.