Skip to content

Commit 6a2962c

Browse files
authored
docs: update generate_fields_docs.py (#21359) (#21582)
1 parent a61af91 commit 6a2962c

File tree

9 files changed

+88
-10
lines changed

9 files changed

+88
-10
lines changed

auditbeat/docs/fields.asciidoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2922,8 +2922,15 @@ type: object
29222922
[[exported-fields-ecs]]
29232923
== ECS fields
29242924
2925-
ECS Fields.
29262925
2926+
This section defines Elastic Common Schema (ECS) fields—a common set of fields
2927+
to be used when storing event data in {es}.
2928+
2929+
This is an exhaustive list, and fields listed here are not necessarily used by {beatname_uc}.
2930+
The goal of ECS is to enable and encourage users of {es} to normalize their event data,
2931+
so that they can better analyze, visualize, and correlate the data represented in their events.
2932+
2933+
See the {ecs-ref}[ECS reference] for more information.
29272934
29282935
*`@timestamp`*::
29292936
+

filebeat/docs/fields.asciidoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33175,8 +33175,15 @@ type: object
3317533175
[[exported-fields-ecs]]
3317633176
== ECS fields
3317733177

33178-
ECS Fields.
3317933178

33179+
This section defines Elastic Common Schema (ECS) fields—a common set of fields
33180+
to be used when storing event data in {es}.
33181+
33182+
This is an exhaustive list, and fields listed here are not necessarily used by {beatname_uc}.
33183+
The goal of ECS is to enable and encourage users of {es} to normalize their event data,
33184+
so that they can better analyze, visualize, and correlate the data represented in their events.
33185+
33186+
See the {ecs-ref}[ECS reference] for more information.
3318033187

3318133188
*`@timestamp`*::
3318233189
+

heartbeat/docs/fields.asciidoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,15 @@ type: object
369369
[[exported-fields-ecs]]
370370
== ECS fields
371371
372-
ECS Fields.
373372
373+
This section defines Elastic Common Schema (ECS) fields—a common set of fields
374+
to be used when storing event data in {es}.
375+
376+
This is an exhaustive list, and fields listed here are not necessarily used by {beatname_uc}.
377+
The goal of ECS is to enable and encourage users of {es} to normalize their event data,
378+
so that they can better analyze, visualize, and correlate the data represented in their events.
379+
380+
See the {ecs-ref}[ECS reference] for more information.
374381
375382
*`@timestamp`*::
376383
+

journalbeat/docs/fields.asciidoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,8 +922,15 @@ type: object
922922
[[exported-fields-ecs]]
923923
== ECS fields
924924
925-
ECS Fields.
926925
926+
This section defines Elastic Common Schema (ECS) fields—a common set of fields
927+
to be used when storing event data in {es}.
928+
929+
This is an exhaustive list, and fields listed here are not necessarily used by {beatname_uc}.
930+
The goal of ECS is to enable and encourage users of {es} to normalize their event data,
931+
so that they can better analyze, visualize, and correlate the data represented in their events.
932+
933+
See the {ecs-ref}[ECS reference] for more information.
927934
928935
*`@timestamp`*::
929936
+

libbeat/scripts/generate_fields_docs.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import argparse
22
from collections import OrderedDict
33
import os
4+
import re
45

56
import yaml
67

@@ -20,11 +21,24 @@ def document_fields(output, section, sections, path):
2021
output.write("[float]\n")
2122

2223
if "description" in section:
23-
if "anchor" in section:
24+
if "anchor" in section and section["name"] == "ECS":
2425
output.write("== {} fields\n\n".format(section["name"]))
26+
output.write("""
27+
This section defines Elastic Common Schema (ECS) fields—a common set of fields
28+
to be used when storing event data in {es}.
29+
30+
This is an exhaustive list, and fields listed here are not necessarily used by {beatname_uc}.
31+
The goal of ECS is to enable and encourage users of {es} to normalize their event data,
32+
so that they can better analyze, visualize, and correlate the data represented in their events.
33+
34+
See the {ecs-ref}[ECS reference] for more information.
35+
""")
36+
elif "anchor" in section:
37+
output.write("== {} fields\n\n".format(section["name"]))
38+
output.write("{}\n\n".format(section["description"]))
2539
else:
2640
output.write("=== {}\n\n".format(section["name"]))
27-
output.write("{}\n\n".format(section["description"]))
41+
output.write("{}\n\n".format(section["description"]))
2842

2943
if "fields" not in section or not section["fields"]:
3044
return
@@ -70,6 +84,14 @@ def document_field(output, field, field_path):
7084
if "path" in field:
7185
output.write("alias to: {}\n\n".format(field["path"]))
7286

87+
# For Apm-Server docs only
88+
# Assign an ECS badge for fields containing "overwrite"
89+
if beat_title == "Apm-Server":
90+
if "overwrite" in field:
91+
# And it's not a Kubernetes field
92+
if re.match("^kubernetes.*", field["field_path"]) is None:
93+
output.write("{yes-icon} {ecs-ref}[ECS] field.\n\n")
94+
7395
if "index" in field:
7496
if not field["index"]:
7597
output.write("{}\n\n".format("Field is not indexed."))

metricbeat/docs/fields.asciidoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8940,8 +8940,15 @@ Stats collected from Dropwizard.
89408940
[[exported-fields-ecs]]
89418941
== ECS fields
89428942

8943-
ECS Fields.
89448943

8944+
This section defines Elastic Common Schema (ECS) fields—a common set of fields
8945+
to be used when storing event data in {es}.
8946+
8947+
This is an exhaustive list, and fields listed here are not necessarily used by {beatname_uc}.
8948+
The goal of ECS is to enable and encourage users of {es} to normalize their event data,
8949+
so that they can better analyze, visualize, and correlate the data represented in their events.
8950+
8951+
See the {ecs-ref}[ECS reference] for more information.
89458952

89468953
*`@timestamp`*::
89478954
+

packetbeat/docs/fields.asciidoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2135,8 +2135,15 @@ type: object
21352135
[[exported-fields-ecs]]
21362136
== ECS fields
21372137
2138-
ECS Fields.
21392138
2139+
This section defines Elastic Common Schema (ECS) fields—a common set of fields
2140+
to be used when storing event data in {es}.
2141+
2142+
This is an exhaustive list, and fields listed here are not necessarily used by {beatname_uc}.
2143+
The goal of ECS is to enable and encourage users of {es} to normalize their event data,
2144+
so that they can better analyze, visualize, and correlate the data represented in their events.
2145+
2146+
See the {ecs-ref}[ECS reference] for more information.
21402147
21412148
*`@timestamp`*::
21422149
+

winlogbeat/docs/fields.asciidoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,15 @@ type: object
228228
[[exported-fields-ecs]]
229229
== ECS fields
230230
231-
ECS Fields.
232231
232+
This section defines Elastic Common Schema (ECS) fields—a common set of fields
233+
to be used when storing event data in {es}.
234+
235+
This is an exhaustive list, and fields listed here are not necessarily used by {beatname_uc}.
236+
The goal of ECS is to enable and encourage users of {es} to normalize their event data,
237+
so that they can better analyze, visualize, and correlate the data represented in their events.
238+
239+
See the {ecs-ref}[ECS reference] for more information.
233240
234241
*`@timestamp`*::
235242
+

x-pack/functionbeat/docs/fields.asciidoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,15 @@ type: object
224224
[[exported-fields-ecs]]
225225
== ECS fields
226226
227-
ECS Fields.
228227
228+
This section defines Elastic Common Schema (ECS) fields—a common set of fields
229+
to be used when storing event data in {es}.
230+
231+
This is an exhaustive list, and fields listed here are not necessarily used by {beatname_uc}.
232+
The goal of ECS is to enable and encourage users of {es} to normalize their event data,
233+
so that they can better analyze, visualize, and correlate the data represented in their events.
234+
235+
See the {ecs-ref}[ECS reference] for more information.
229236
230237
*`@timestamp`*::
231238
+

0 commit comments

Comments
 (0)