From 753566b290c38bb3bd8f8262561f7559960b5271 Mon Sep 17 00:00:00 2001 From: Nicolas Ruflin Date: Mon, 3 Dec 2018 11:18:08 +0100 Subject: [PATCH] Fix alias field generation in docs (#9269) Alias fields documented in the fields list were not correct. The reason is that `path` was used in our generation of the docs for a different puprose. This one was renamed and reporting of path was added for field alias. --- auditbeat/docs/fields.asciidoc | 8 +- filebeat/docs/fields.asciidoc | 460 +++++++++++++++++------ heartbeat/docs/fields.asciidoc | 8 +- journalbeat/docs/fields.asciidoc | 8 +- libbeat/scripts/generate_fields_docs.py | 13 +- metricbeat/docs/fields.asciidoc | 8 +- packetbeat/docs/fields.asciidoc | 8 +- winlogbeat/docs/fields.asciidoc | 8 +- x-pack/functionbeat/docs/fields.asciidoc | 8 +- 9 files changed, 394 insertions(+), 135 deletions(-) diff --git a/auditbeat/docs/fields.asciidoc b/auditbeat/docs/fields.asciidoc index 110ed335641..6f6bf90ba26 100644 --- a/auditbeat/docs/fields.asciidoc +++ b/auditbeat/docs/fields.asciidoc @@ -4679,18 +4679,22 @@ Minor version of the operating system. -- -*`agent.type`*:: +*`beat.name`*:: + -- type: alias +alias to: agent.type + -- -*`agent.hostname`*:: +*`beat.hostname`*:: + -- type: alias +alias to: agent.hostname + -- [[exported-fields-file_integrity]] diff --git a/filebeat/docs/fields.asciidoc b/filebeat/docs/fields.asciidoc index 001094c185d..7255b895174 100644 --- a/filebeat/docs/fields.asciidoc +++ b/filebeat/docs/fields.asciidoc @@ -81,167 +81,213 @@ The number of bytes of the server response body. -- -*`user.name`*:: +*`apache2.access.user_name`*:: + -- type: alias +alias to: user.name + -- -*`http.request.method`*:: +*`apache2.access.method`*:: + -- type: alias +alias to: http.request.method + -- -*`url.original`*:: +*`apache2.access.url`*:: + -- type: alias +alias to: url.original + -- -*`http.version`*:: +*`apache2.access.http_version`*:: + -- type: alias +alias to: http.version + -- -*`http.response.status_code`*:: +*`apache2.access.response_code`*:: + -- type: alias +alias to: http.response.status_code + -- -*`http.request.referrer`*:: +*`apache2.access.referrer`*:: + -- type: alias +alias to: http.request.referrer + -- -*`user_agent.original`*:: +*`apache2.access.agent`*:: + -- type: alias +alias to: user_agent.original + -- -*`user_agent.device`*:: +*`apache2.access.user_agent.device`*:: + -- type: alias +alias to: user_agent.device + -- -*`user_agent.major`*:: +*`apache2.access.user_agent.major`*:: + -- type: alias +alias to: user_agent.major + -- -*`user_agent.minor`*:: +*`apache2.access.user_agent.minor`*:: + -- type: alias +alias to: user_agent.minor + -- -*`user_agent.patch`*:: +*`apache2.access.user_agent.patch`*:: + -- type: alias +alias to: user_agent.patch + -- -*`user_agent.name`*:: +*`apache2.access.user_agent.name`*:: + -- type: alias +alias to: user_agent.name + -- -*`user_agent.os.full_name`*:: +*`apache2.access.user_agent.os`*:: + -- type: alias +alias to: user_agent.os.full_name + -- -*`user_agent.os.major`*:: +*`apache2.access.user_agent.os_major`*:: + -- type: alias +alias to: user_agent.os.major + -- -*`user_agent.os.minor`*:: +*`apache2.access.user_agent.os_minor`*:: + -- type: alias +alias to: user_agent.os.minor + -- -*`user_agent.os.name`*:: +*`apache2.access.user_agent.os_name`*:: + -- type: alias +alias to: user_agent.os.name + -- -*`user_agent.original`*:: +*`apache2.access.user_agent.original`*:: + -- type: alias +alias to: user_agent.original + -- -*`source.geo.continent_name`*:: +*`apache2.access.geoip.continent_name`*:: + -- type: alias +alias to: source.geo.continent_name + -- -*`source.geo.country_iso_code`*:: +*`apache2.access.geoip.country_iso_code`*:: + -- type: alias +alias to: source.geo.country_iso_code + -- -*`source.geo.location`*:: +*`apache2.access.geoip.location`*:: + -- type: alias +alias to: source.geo.location + -- -*`source.geo.region_name`*:: +*`apache2.access.geoip.region_name`*:: + -- type: alias +alias to: source.geo.region_name + -- -*`source.geo.city_name`*:: +*`apache2.access.geoip.city_name`*:: + -- type: alias +alias to: source.geo.city_name + -- -*`source.geo.region_iso_code`*:: +*`apache2.access.geoip.region_iso_code`*:: + -- type: alias +alias to: source.geo.region_iso_code + -- [float] @@ -2649,18 +2695,22 @@ Minor version of the operating system. -- -*`agent.type`*:: +*`beat.name`*:: + -- type: alias +alias to: agent.type + -- -*`agent.hostname`*:: +*`beat.hostname`*:: + -- type: alias +alias to: agent.hostname + -- [[exported-fields-elasticsearch]] @@ -3487,25 +3537,31 @@ If connection is via unix socket, socket path is in this field. -- -*`source.port`*:: +*`haproxy.client.port`*:: + -- type: alias +alias to: source.port + -- -*`process.name`*:: +*`haproxy.process_name`*:: + -- type: alias +alias to: process.name + -- -*`process.pid`*:: +*`haproxy.pid`*:: + -- type: alias +alias to: process.pid + -- [float] @@ -3514,18 +3570,22 @@ type: alias Destination information -*`destination.port`*:: +*`haproxy.destination.port`*:: + -- type: alias +alias to: destination.port + -- -*`destination.ip`*:: +*`haproxy.destination.ip`*:: + -- type: alias +alias to: destination.ip + -- [float] @@ -3535,46 +3595,58 @@ Contains GeoIP information gathered based on the client.ip field. Only present i -*`source.geo.continent_name`*:: +*`haproxy.geoip.continent_name`*:: + -- type: alias +alias to: source.geo.continent_name + -- -*`source.geo.country_iso_code`*:: +*`haproxy.geoip.country_iso_code`*:: + -- type: alias +alias to: source.geo.country_iso_code + -- -*`source.geo.location`*:: +*`haproxy.geoip.location`*:: + -- type: alias +alias to: source.geo.location + -- -*`source.geo.region_name`*:: +*`haproxy.geoip.region_name`*:: + -- type: alias +alias to: source.geo.region_name + -- -*`source.geo.city_name`*:: +*`haproxy.geoip.city_name`*:: + -- type: alias +alias to: source.geo.city_name + -- -*`source.geo.region_iso_code`*:: +*`haproxy.geoip.region_iso_code`*:: + -- type: alias +alias to: source.geo.region_iso_code + -- [float] @@ -3947,195 +4019,249 @@ The number of bytes of the server request body. -- -*`destination.ip`*:: +*`iis.access.server_ip`*:: + -- type: alias +alias to: destination.ip + -- -*`http.request.method`*:: +*`iis.access.method`*:: + -- type: alias +alias to: http.request.method + -- -*`url.path`*:: +*`iis.access.url`*:: + -- type: alias +alias to: url.path + -- -*`url.query`*:: +*`iis.access.query_string`*:: + -- type: alias +alias to: url.query + -- -*`destination.port`*:: +*`iis.access.port`*:: + -- type: alias +alias to: destination.port + -- -*`user.name`*:: +*`iis.access.user_name`*:: + -- type: alias +alias to: user.name + -- -*`source.ip`*:: +*`iis.access.remote_ip`*:: + -- type: alias +alias to: source.ip + -- -*`http.request.referrer`*:: +*`iis.access.referrer`*:: + -- type: alias +alias to: http.request.referrer + -- -*`http.response.status_code`*:: +*`iis.access.response_code`*:: + -- type: alias +alias to: http.response.status_code + -- -*`http.version`*:: +*`iis.access.http_version`*:: + -- type: alias +alias to: http.version + -- -*`host.hostname`*:: +*`iis.access.hostname`*:: + -- type: alias +alias to: host.hostname + -- -*`user_agent.device`*:: +*`iis.access.user_agent.device`*:: + -- type: alias +alias to: user_agent.device + -- -*`user_agent.major`*:: +*`iis.access.user_agent.major`*:: + -- type: alias +alias to: user_agent.major + -- -*`user_agent.minor`*:: +*`iis.access.user_agent.minor`*:: + -- type: alias +alias to: user_agent.minor + -- -*`user_agent.patch`*:: +*`iis.access.user_agent.patch`*:: + -- type: alias +alias to: user_agent.patch + -- -*`user_agent.name`*:: +*`iis.access.user_agent.name`*:: + -- type: alias +alias to: user_agent.name + -- -*`user_agent.os.full_name`*:: +*`iis.access.user_agent.os`*:: + -- type: alias +alias to: user_agent.os.full_name + -- -*`user_agent.os.major`*:: +*`iis.access.user_agent.os_major`*:: + -- type: alias +alias to: user_agent.os.major + -- -*`user_agent.os.minor`*:: +*`iis.access.user_agent.os_minor`*:: + -- type: alias +alias to: user_agent.os.minor + -- -*`user_agent.os.name`*:: +*`iis.access.user_agent.os_name`*:: + -- type: alias +alias to: user_agent.os.name + -- -*`user_agent.original`*:: +*`iis.access.user_agent.original`*:: + -- type: alias +alias to: user_agent.original + -- -*`source.geo.continent_name`*:: +*`iis.access.geoip.continent_name`*:: + -- type: alias +alias to: source.geo.continent_name + -- -*`source.geo.country_iso_code`*:: +*`iis.access.geoip.country_iso_code`*:: + -- type: alias +alias to: source.geo.country_iso_code + -- -*`source.geo.location`*:: +*`iis.access.geoip.location`*:: + -- type: alias +alias to: source.geo.location + -- -*`source.geo.region_name`*:: +*`iis.access.geoip.region_name`*:: + -- type: alias +alias to: source.geo.region_name + -- -*`source.geo.city_name`*:: +*`iis.access.geoip.city_name`*:: + -- type: alias +alias to: source.geo.city_name + -- -*`source.geo.region_iso_code`*:: +*`iis.access.geoip.region_iso_code`*:: + -- type: alias +alias to: source.geo.region_iso_code + -- [float] @@ -4748,18 +4874,22 @@ Referrer for this HTTP request. -- -*`event.dataset`*:: +*`fileset.name`*:: + -- type: alias +alias to: event.dataset + -- -*`event.module`*:: +*`fileset.module`*:: + -- type: alias +alias to: event.module + -- [[exported-fields-logstash]] @@ -5206,181 +5336,231 @@ The number of bytes of the server response body. -- -*`network.forwarded_ip`*:: +*`nginx.access.remote_ip_list`*:: + -- type: alias +alias to: network.forwarded_ip + -- -*`source.ip`*:: +*`nginx.access.remote_ip`*:: + -- type: alias +alias to: source.ip + -- -*`user.name`*:: +*`nginx.access.user_name`*:: + -- type: alias +alias to: user.name + -- -*`http.request.method`*:: +*`nginx.access.method`*:: + -- type: alias +alias to: http.request.method + -- -*`url.original`*:: +*`nginx.access.url`*:: + -- type: alias +alias to: url.original + -- -*`http.version`*:: +*`nginx.access.http_version`*:: + -- type: alias +alias to: http.version + -- -*`http.response.status_code`*:: +*`nginx.access.response_code`*:: + -- type: alias +alias to: http.response.status_code + -- -*`http.request.referrer`*:: +*`nginx.access.referrer`*:: + -- type: alias +alias to: http.request.referrer + -- -*`user_agent.original`*:: +*`nginx.access.agent`*:: + -- type: alias +alias to: user_agent.original + -- -*`user_agent.device`*:: +*`nginx.access.user_agent.device`*:: + -- type: alias +alias to: user_agent.device + -- -*`user_agent.major`*:: +*`nginx.access.user_agent.major`*:: + -- type: alias +alias to: user_agent.major + -- -*`user_agent.minor`*:: +*`nginx.access.user_agent.minor`*:: + -- type: alias +alias to: user_agent.minor + -- -*`user_agent.patch`*:: +*`nginx.access.user_agent.patch`*:: + -- type: alias +alias to: user_agent.patch + -- -*`user_agent.name`*:: +*`nginx.access.user_agent.name`*:: + -- type: alias +alias to: user_agent.name + -- -*`user_agent.os.full_name`*:: +*`nginx.access.user_agent.os`*:: + -- type: alias +alias to: user_agent.os.full_name + -- -*`user_agent.os.major`*:: +*`nginx.access.user_agent.os_major`*:: + -- type: alias +alias to: user_agent.os.major + -- -*`user_agent.os.minor`*:: +*`nginx.access.user_agent.os_minor`*:: + -- type: alias +alias to: user_agent.os.minor + -- -*`user_agent.os.name`*:: +*`nginx.access.user_agent.os_name`*:: + -- type: alias +alias to: user_agent.os.name + -- -*`user_agent.original`*:: +*`nginx.access.user_agent.original`*:: + -- type: alias +alias to: user_agent.original + -- -*`source.geo.continent_name`*:: +*`nginx.access.geoip.continent_name`*:: + -- type: alias +alias to: source.geo.continent_name + -- -*`source.geo.country_iso_code`*:: +*`nginx.access.geoip.country_iso_code`*:: + -- type: alias +alias to: source.geo.country_iso_code + -- -*`source.geo.location`*:: +*`nginx.access.geoip.location`*:: + -- type: alias +alias to: source.geo.location + -- -*`source.geo.region_name`*:: +*`nginx.access.geoip.region_name`*:: + -- type: alias +alias to: source.geo.region_name + -- -*`source.geo.city_name`*:: +*`nginx.access.geoip.city_name`*:: + -- type: alias +alias to: source.geo.city_name + -- -*`source.geo.region_iso_code`*:: +*`nginx.access.geoip.region_iso_code`*:: + -- type: alias +alias to: source.geo.region_iso_code + -- [float] @@ -5781,46 +5961,58 @@ Fields from the Linux authorization logs. -*`@timestamp`*:: +*`system.auth.timestamp`*:: + -- type: alias +alias to: @timestamp + -- -*`host.hostname`*:: +*`system.auth.hostname`*:: + -- type: alias +alias to: host.hostname + -- -*`process.name`*:: +*`system.auth.program`*:: + -- type: alias +alias to: process.name + -- -*`process.pid`*:: +*`system.auth.pid`*:: + -- type: alias +alias to: process.pid + -- -*`message`*:: +*`system.auth.message`*:: + -- type: alias +alias to: message + -- -*`user.name`*:: +*`system.auth.user`*:: + -- type: alias +alias to: user.name + -- @@ -5850,68 +6042,86 @@ The client IP from SSH connections that are open and immediately dropped. -- -*`event.action`*:: +*`system.auth.ssh.event`*:: + -- type: alias +alias to: event.action + -- -*`source.ip`*:: +*`system.auth.ssh.ip`*:: + -- type: alias +alias to: source.ip + -- -*`source.port`*:: +*`system.auth.ssh.port`*:: + -- type: alias +alias to: source.port + -- -*`source.geo.continent_name`*:: +*`system.auth.ssh.geoip.continent_name`*:: + -- type: alias +alias to: source.geo.continent_name + -- -*`source.geo.country_iso_code`*:: +*`system.auth.ssh.geoip.country_iso_code`*:: + -- type: alias +alias to: source.geo.country_iso_code + -- -*`source.geo.location`*:: +*`system.auth.ssh.geoip.location`*:: + -- type: alias +alias to: source.geo.location + -- -*`source.geo.region_name`*:: +*`system.auth.ssh.geoip.region_name`*:: + -- type: alias +alias to: source.geo.region_name + -- -*`source.geo.city_name`*:: +*`system.auth.ssh.geoip.city_name`*:: + -- type: alias +alias to: source.geo.city_name + -- -*`source.geo.region_iso_code`*:: +*`system.auth.ssh.geoip.region_iso_code`*:: + -- type: alias +alias to: source.geo.region_iso_code + -- [float] @@ -5986,25 +6196,31 @@ The default shell for the new user. -- -*`user.name`*:: +*`system.auth.useradd.name`*:: + -- type: alias +alias to: user.name + -- -*`user.id`*:: +*`system.auth.useradd.uid`*:: + -- type: alias +alias to: user.id + -- -*`group.id`*:: +*`system.auth.useradd.gid`*:: + -- type: alias +alias to: group.id + -- [float] @@ -6014,18 +6230,22 @@ Fields specific to events created by the `groupadd` command. -*`group.name`*:: +*`system.auth.groupadd.name`*:: + -- type: alias +alias to: group.name + -- -*`group.id`*:: +*`system.auth.groupadd.gid`*:: + -- type: alias +alias to: group.id + -- [float] @@ -6035,39 +6255,49 @@ Contains fields from the syslog system logs. -*`@timestamp`*:: +*`system.syslog.timestamp`*:: + -- type: alias +alias to: @timestamp + -- -*`host.hostname`*:: +*`system.syslog.hostname`*:: + -- type: alias +alias to: host.hostname + -- -*`process.name`*:: +*`system.syslog.program`*:: + -- type: alias +alias to: process.name + -- -*`process.pid`*:: +*`system.syslog.pid`*:: + -- type: alias +alias to: process.pid + -- -*`message`*:: +*`system.syslog.message`*:: + -- type: alias +alias to: message + -- [[exported-fields-traefik]] diff --git a/heartbeat/docs/fields.asciidoc b/heartbeat/docs/fields.asciidoc index 1f998a3df65..2301ae01689 100644 --- a/heartbeat/docs/fields.asciidoc +++ b/heartbeat/docs/fields.asciidoc @@ -2271,18 +2271,22 @@ Minor version of the operating system. -- -*`agent.type`*:: +*`beat.name`*:: + -- type: alias +alias to: agent.type + -- -*`agent.hostname`*:: +*`beat.hostname`*:: + -- type: alias +alias to: agent.hostname + -- [[exported-fields-host-processor]] diff --git a/journalbeat/docs/fields.asciidoc b/journalbeat/docs/fields.asciidoc index 25c53618096..98fe5775493 100644 --- a/journalbeat/docs/fields.asciidoc +++ b/journalbeat/docs/fields.asciidoc @@ -2564,18 +2564,22 @@ Minor version of the operating system. -- -*`agent.type`*:: +*`beat.name`*:: + -- type: alias +alias to: agent.type + -- -*`agent.hostname`*:: +*`beat.hostname`*:: + -- type: alias +alias to: agent.hostname + -- [[exported-fields-host-processor]] diff --git a/libbeat/scripts/generate_fields_docs.py b/libbeat/scripts/generate_fields_docs.py index 0aa6a31a877..cf7841acb7a 100644 --- a/libbeat/scripts/generate_fields_docs.py +++ b/libbeat/scripts/generate_fields_docs.py @@ -41,12 +41,12 @@ def document_fields(output, section, sections, path): document_field(output, field, newpath) -def document_field(output, field, path): +def document_field(output, field, field_path): - if "path" not in field: - field["path"] = path + if "field_path" not in field: + field["field_path"] = field_path - output.write("*`{}`*::\n+\n--\n".format(field["path"])) + output.write("*`{}`*::\n+\n--\n".format(field["field_path"])) if "deprecated" in field: output.write("\ndeprecated[{}]\n\n".format(field["deprecated"])) @@ -59,7 +59,8 @@ def document_field(output, field, path): output.write("format: {}\n\n".format(field["format"])) if "required" in field: output.write("required: {}\n\n".format(field["required"])) - + if "path" in field: + output.write("alias to: {}\n\n".format(field["path"])) if "description" in field: output.write("{}\n\n".format(field["description"])) @@ -73,7 +74,7 @@ def document_field(output, field, path): if "multi_fields" in field: for subfield in field["multi_fields"]: - document_field(output, subfield, path + "." + subfield["name"]) + document_field(output, subfield, field_path + "." + subfield["name"]) output.write("--\n\n") diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 9bd23d44cd2..1c04a31a5cb 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -5324,18 +5324,22 @@ Minor version of the operating system. -- -*`agent.type`*:: +*`beat.name`*:: + -- type: alias +alias to: agent.type + -- -*`agent.hostname`*:: +*`beat.hostname`*:: + -- type: alias +alias to: agent.hostname + -- [[exported-fields-elasticsearch]] diff --git a/packetbeat/docs/fields.asciidoc b/packetbeat/docs/fields.asciidoc index b52ca835d73..fa9bd4ff270 100644 --- a/packetbeat/docs/fields.asciidoc +++ b/packetbeat/docs/fields.asciidoc @@ -4207,18 +4207,22 @@ Minor version of the operating system. -- -*`agent.type`*:: +*`beat.name`*:: + -- type: alias +alias to: agent.type + -- -*`agent.hostname`*:: +*`beat.hostname`*:: + -- type: alias +alias to: agent.hostname + -- [[exported-fields-flows_event]] diff --git a/winlogbeat/docs/fields.asciidoc b/winlogbeat/docs/fields.asciidoc index 83ef59b6946..f3699460a10 100644 --- a/winlogbeat/docs/fields.asciidoc +++ b/winlogbeat/docs/fields.asciidoc @@ -2184,18 +2184,22 @@ Minor version of the operating system. -- -*`agent.type`*:: +*`beat.name`*:: + -- type: alias +alias to: agent.type + -- -*`agent.hostname`*:: +*`beat.hostname`*:: + -- type: alias +alias to: agent.hostname + -- [[exported-fields-eventlog]] diff --git a/x-pack/functionbeat/docs/fields.asciidoc b/x-pack/functionbeat/docs/fields.asciidoc index 74100fab9fb..ffe5d10ad5f 100644 --- a/x-pack/functionbeat/docs/fields.asciidoc +++ b/x-pack/functionbeat/docs/fields.asciidoc @@ -2165,18 +2165,22 @@ Minor version of the operating system. -- -*`agent.type`*:: +*`beat.name`*:: + -- type: alias +alias to: agent.type + -- -*`agent.hostname`*:: +*`beat.hostname`*:: + -- type: alias +alias to: agent.hostname + -- [[exported-fields-functionbeat]]