Skip to content

Commit

Permalink
Rename filebeat apache2 module to apache (#9402)
Browse files Browse the repository at this point in the history
Rename filebeat `apache2` module to `apache`. `apache2` module
is kept as a "moved" module (#9432) so existing configurations continue
working.

Aliases for renamed fields are added and they will be handled as fields
renamed for ECS.
  • Loading branch information
jsoriano authored Jan 12, 2019
1 parent 14373c7 commit 1ce20cb
Show file tree
Hide file tree
Showing 42 changed files with 442 additions and 381 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha1...v7.0.0-alpha2[Check the
- Rename many `nginx.access.*` fields to map to ECS. {pull}9081[9081]
- Rename many `system.auth.*` fields to map to ECS. {pull}9138[9138]
- Rename many `apache2.access.*` fields to map to ECS. {pull}9245[9245]
- Rename `apache2` module to `apache`. {pull}9402[9402]
*Metricbeat*
Expand Down
5 changes: 5 additions & 0 deletions dev-tools/cmd/module_fields/module_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ func main() {
if err != nil {
log.Fatalf("Error fetching files for module %v: %v", module, err)
}
if len(files) == 0 {
// This can happen on moved modules
log.Printf("No fields files for module %v", module)
continue
}

data, err := fields.GenerateFieldsYml(files)
if err != nil {
Expand Down
126 changes: 79 additions & 47 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This file is generated! See _meta/fields.yml and scripts/generate_field_docs.py
This document describes the fields that are exported by Filebeat. They are
grouped in the following categories:
* <<exported-fields-apache2>>
* <<exported-fields-apache>>
* <<exported-fields-auditd>>
* <<exported-fields-beat>>
* <<exported-fields-cloud>>
Expand Down Expand Up @@ -42,66 +42,54 @@ grouped in the following categories:
* <<exported-fields-traefik>>
--
[[exported-fields-apache2]]
== Apache2 fields
[[exported-fields-apache]]
== Apache fields
Apache2 Module
Apache Module
[float]
== apache2 fields
Apache2 fields.
Aliases for backward compatibility with old apache2 fields
[float]
== access fields
Contains fields for the Apache2 HTTPD access logs.
*`apache2.access.remote_ip`*::
+
--
type: keyword
Client IP address or hostname.
type: alias
alias to: apache.access.remote_ip
--
*`apache2.access.ssl.protocol`*::
+
--
type: keyword
SSL protocol version.
type: alias
alias to: apache.access.ssl.protocol
--
*`apache2.access.ssl.cipher`*::
+
--
type: keyword
SSL cipher name.
type: alias
alias to: apache.access.ssl.cipher
--
*`apache2.access.body_sent.bytes`*::
+
--
type: long
format: bytes
The number of bytes of the server response body.
type: alias
alias to: apache.access.body_sent.bytes
--
Expand Down Expand Up @@ -314,12 +302,6 @@ alias to: source.geo.region_iso_code
--
[float]
== error fields
Fields from the Apache error logs.
*`apache2.error.level`*::
+
Expand All @@ -328,58 +310,108 @@ type: alias
alias to: log.level
The severity level of the message.
--
*`apache2.error.message`*::
+
--
type: alias
alias to: message
--
*`apache2.error.client`*::
*`apache2.error.pid`*::
+
--
type: keyword
type: alias
The IP address of the client that generated the error.
alias to: process.pid
--
*`apache2.error.tid`*::
+
--
type: alias
*`apache2.error.message`*::
alias to: process.thread.id
--
*`apache2.error.module`*::
+
--
type: alias
alias to: message
alias to: apache.error.module
--
[float]
== apache fields
Apache fields.
[float]
== access fields
Contains fields for the Apache HTTP Server access logs.
The logged message.
*`apache.access.remote_ip`*::
+
--
type: keyword
*`apache2.error.pid`*::
Client IP address or hostname.
--
*`apache.access.ssl.protocol`*::
+
--
type: alias
type: keyword
alias to: process.pid
SSL protocol version.
The process ID.
--
*`apache.access.ssl.cipher`*::
+
--
type: keyword
*`apache2.error.tid`*::
SSL cipher name.
--
*`apache.access.body_sent.bytes`*::
+
--
type: alias
type: long
alias to: process.thread.id
format: bytes
The thread ID.
The number of bytes of the server response body.
--
*`apache2.error.module`*::
[float]
== error fields
Fields from the Apache error logs.
*`apache.error.module`*::
+
--
type: keyword
Expand Down
6 changes: 3 additions & 3 deletions filebeat/docs/filebeat-modules-options.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:modulename: apache2 mysql
:modulename: apache mysql

[id="configuration-{beatname_lc}-modules"]
== Specify which modules to run
Expand Down Expand Up @@ -38,13 +38,13 @@ available in {beatname_uc}. You can enable or disable specific module configurat
under `modules.d` by running the
<<modules-command,`modules enable` or `modules disable`>> commands.

For example, to enable the `apache2` and `mysql` configs in the `modules.d`
For example, to enable the `apache` and `mysql` configs in the `modules.d`
directory, you use:

include::./include/enable-modules-command.asciidoc[]

Then when you run {beatname_uc}, it loads the corresponding module configurations
specified in the `modules.d` directory (for example, `modules.d/apache2.yml` and
specified in the `modules.d` directory (for example, `modules.d/apache.yml` and
`modules.d/mysql.yml`).

To see a list of enabled and disabled modules, run:
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
This file is generated! See scripts/docs_collector.py
////

[[filebeat-module-apache2]]
:modulename: apache2
[[filebeat-module-apache]]
:modulename: apache
:has-dashboards: true

== Apache2 module
== Apache module

The +{modulename}+ module parses access and error logs created by the
https://httpd.apache.org/[Apache HTTP] server.
Expand All @@ -23,7 +23,7 @@ This module requires the

The +{modulename}+ module was tested with logs from versions 2.2.22 and 2.4.23.

On Windows, the module was tested with Apache2 installed from the Chocolatey
On Windows, the module was tested with Apache HTTP Server installed from the Chocolatey
repository.

include::../include/running-modules.asciidoc[]
Expand All @@ -34,30 +34,30 @@ include::../include/running-modules.asciidoc[]
This module comes with a sample dashboard. For example:

[role="screenshot"]
image::./images/kibana-apache2.png[]
image::./images/kibana-apache.png[]

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 Apache2 access and error logs:
file to override the default paths for Apache HTTP Server access and error logs:

["source","yaml",subs="attributes"]
-----
- module: apache2
- module: apache
access:
enabled: true
var.paths: ["/path/to/log/apache2/access.log*"]
var.paths: ["/path/to/log/apache/access.log*"]
error:
enabled: true
var.paths: ["/path/to/log/apache2/error.log*"]
var.paths: ["/path/to/log/apache/error.log*"]
-----


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

["source","sh",subs="attributes"]
-----
-M "apache2.access.var.paths=[/path/to/apache2/access.log*]" -M "apache2.error.var.paths=[/path/to/log/apache2/error.log*]"
-M "apache.access.var.paths=[/path/to/apache/access.log*]" -M "apache.error.var.paths=[/path/to/log/apache/error.log*]"
-----


Expand Down Expand Up @@ -87,5 +87,5 @@ include::../include/var-paths.asciidoc[]
=== Fields

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

4 changes: 2 additions & 2 deletions filebeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This file is generated! See scripts/docs_collector.py
////

* <<filebeat-modules-overview>>
* <<filebeat-module-apache2>>
* <<filebeat-module-apache>>
* <<filebeat-module-auditd>>
* <<filebeat-module-elasticsearch>>
* <<filebeat-module-haproxy>>
Expand All @@ -27,7 +27,7 @@ This file is generated! See scripts/docs_collector.py
--

include::modules-overview.asciidoc[]
include::modules/apache2.asciidoc[]
include::modules/apache.asciidoc[]
include::modules/auditd.asciidoc[]
include::modules/elasticsearch.asciidoc[]
include::modules/haproxy.asciidoc[]
Expand Down
2 changes: 1 addition & 1 deletion filebeat/docs/reload-configuration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ For example:

[source,yaml]
------------------------------------------------------------------------------
- module: apache2
- module: apache
access:
enabled: true
var.paths: [/var/log/apache2/access.log*]
Expand Down
4 changes: 2 additions & 2 deletions filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ filebeat.modules:
# can be added under this section.
#input:

#------------------------------- Apache2 Module -------------------------------
#- module: apache2
#-------------------------------- Apache Module --------------------------------
#- module: apache
# Access logs
#access:
#enabled: true
Expand Down
2 changes: 1 addition & 1 deletion filebeat/include/list.go

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#- module: apache2
#- module: apache
# Access logs
#access:
#enabled: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- module: apache2
- module: apache
# Access logs
access:
enabled: true
Expand Down
Loading

0 comments on commit 1ce20cb

Please sign in to comment.