Skip to content

Commit 7c8cd17

Browse files
authored
Add --force-docs option (#1879)
* add --force-docs flag * document --force-docs * include mixing doc updates * changelog
1 parent ab98148 commit 7c8cd17

File tree

7 files changed

+93
-48
lines changed

7 files changed

+93
-48
lines changed

CHANGELOG.next.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Thanks, you're awesome :-) -->
8585

8686
* Adding optional field attribute, `pattern`. #1834
8787
* Added support for re-using a fieldset as an array. #1838
88+
* Added `--force-docs` option to generator. #1879
8889

8990
#### Improvements
9091

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ generate: generator
6666
# Run the new generator
6767
.PHONY: generator
6868
generator: ve
69-
$(PYTHON) scripts/generator.py --strict --include "${INCLUDE}" --subset "${SUBSETS_DIR}"
69+
$(PYTHON) scripts/generator.py --strict --include "${INCLUDE}" --subset "${SUBSETS_DIR}" --force-docs
7070

7171
# Check Makefile format.
7272
.PHONY: makelint

USAGE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ relevant artifacts for their unique set of data sources.
3232
+ [Mapping & Template Settings](#mapping--template-settings)
3333
+ [Strict Mode](#strict-mode)
3434
+ [Intermediate-Only](#intermediate-only)
35+
+ [Force-docs](#force-docs)
3536

3637
## TLDR Example
3738

@@ -444,3 +445,8 @@ This will cause an exception when running in strict mode.
444445

445446
The `--intermediate-only` argument is used for debugging purposes. It only generates the ["intermediate files"](generated/ecs), `ecs_flat.yml` and `ecs_nested.yml`, without generating the rest of the artifacts.
446447
More information on the different intermediate files can be found in the generated directory's [README](generated/README.md).
448+
449+
#### Force-docs
450+
451+
By default, running the generator with `--subset`, `--include`, or `--exclude` flags will not generate the ECS docs in the `docs` directory. Use `--force-docs` to force the documentation to generate
452+
even if one of those flags is also present.

docs/fields/field-details.asciidoc

Lines changed: 80 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6302,6 +6302,22 @@ type: keyword
63026302

63036303
example: `v1beta1`
63046304

6305+
| extended
6306+
6307+
// ===============================================================
6308+
6309+
|
6310+
[[field-orchestrator-cluster-id]]
6311+
<<field-orchestrator-cluster-id, orchestrator.cluster.id>>
6312+
6313+
| Unique ID of the cluster.
6314+
6315+
type: keyword
6316+
6317+
6318+
6319+
6320+
63056321
| extended
63066322

63076323
// ===============================================================
@@ -7156,24 +7172,6 @@ type: keyword
71567172

71577173
example: `c2c455d9f99375d`
71587174

7159-
| extended
7160-
7161-
// ===============================================================
7162-
7163-
|
7164-
[[field-process-entry-meta-type]]
7165-
<<field-process-entry-meta-type, process.entry_meta.type>>
7166-
7167-
| beta:[ This field is beta and subject to change. ]
7168-
7169-
The entry type for the entry session leader. Values include: init(e.g systemd), sshd, ssm, kubelet, teleport, terminal, console
7170-
7171-
type: keyword
7172-
7173-
7174-
7175-
7176-
71777175
| extended
71787176

71797177
// ===============================================================
@@ -7316,32 +7314,6 @@ example: `4242`
73167314

73177315
// ===============================================================
73187316

7319-
|
7320-
[[field-process-same-as-process]]
7321-
<<field-process-same-as-process, process.same_as_process>>
7322-
7323-
| beta:[ This field is beta and subject to change. ]
7324-
7325-
This boolean is used to identify if a leader process is the same as the top level process.
7326-
7327-
For example, if `process.group_leader.same_as_process = true`, it means the process event in question is the leader of its process group. Details under `process.*` like `pid` would be the same under `process.group_leader.*` The same applies for both `process.session_leader` and `process.entry_leader`.
7328-
7329-
This field exists to the benefit of EQL and other rule engines since it's not possible to compare equality between two fields in a single document. e.g `process.entity_id` = `process.group_leader.entity_id` (top level process is the process group leader) OR `process.entity_id` = `process.entry_leader.entity_id` (top level process is the entry session leader)
7330-
7331-
Instead these rules could be written like: `process.group_leader.same_as_process: true` OR `process.entry_leader.same_as_process: true`
7332-
7333-
Note: This field is only set on `process.entry_leader`, `process.session_leader` and `process.group_leader`.
7334-
7335-
type: boolean
7336-
7337-
7338-
7339-
example: `True`
7340-
7341-
| extended
7342-
7343-
// ===============================================================
7344-
73457317
|
73467318
[[field-process-start]]
73477319
<<field-process-start, process.start>>
@@ -9406,6 +9378,70 @@ example: `indicator_match_rule`
94069378

94079379
// ===============================================================
94089380

9381+
|
9382+
[[field-threat-feed-dashboard-id]]
9383+
<<field-threat-feed-dashboard-id, threat.feed.dashboard_id>>
9384+
9385+
| The saved object ID of the dashboard belonging to the threat feed for displaying dashboard links to threat feeds in Kibana.
9386+
9387+
type: keyword
9388+
9389+
9390+
9391+
example: `5ba16340-72e6-11eb-a3e3-b3cc7c78a70f`
9392+
9393+
| extended
9394+
9395+
// ===============================================================
9396+
9397+
|
9398+
[[field-threat-feed-description]]
9399+
<<field-threat-feed-description, threat.feed.description>>
9400+
9401+
| Description of the threat feed in a UI friendly format.
9402+
9403+
type: keyword
9404+
9405+
9406+
9407+
example: `Threat feed from the AlienVault Open Threat eXchange network.`
9408+
9409+
| extended
9410+
9411+
// ===============================================================
9412+
9413+
|
9414+
[[field-threat-feed-name]]
9415+
<<field-threat-feed-name, threat.feed.name>>
9416+
9417+
| The name of the threat feed in UI friendly format.
9418+
9419+
type: keyword
9420+
9421+
9422+
9423+
example: `AlienVault OTX`
9424+
9425+
| extended
9426+
9427+
// ===============================================================
9428+
9429+
|
9430+
[[field-threat-feed-reference]]
9431+
<<field-threat-feed-reference, threat.feed.reference>>
9432+
9433+
| Reference information for the threat feed in a UI friendly format.
9434+
9435+
type: keyword
9436+
9437+
9438+
9439+
example: `https://otx.alienvault.com`
9440+
9441+
| extended
9442+
9443+
// ===============================================================
9444+
94099445
|
94109446
[[field-threat-framework]]
94119447
<<field-threat-framework, threat.framework>>

docs/fields/fields.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[ecs-field-reference]]
22
== {ecs} Field Reference
33

4-
This is the documentation of ECS version 8.3.0-dev.
4+
This is the documentation of ECS version 8.4.0-dev.
55

66
ECS defines multiple groups of related fields. They are called "field sets".
77
The <<ecs-base,Base>> field set is the only one whose fields are defined

docs/index.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
1313
[[ecs-reference]]
1414
== Overview
1515

16-
This is the documentation of ECS version 8.3.0-dev.
16+
This is the documentation of ECS version 8.4.0-dev.
1717

1818
[float]
1919
=== What is ECS?

scripts/generator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def main():
7474
es_template.generate_legacy(flat, ecs_generated_version, out_dir,
7575
args.mapping_settings, args.template_settings_legacy)
7676
beats.generate(nested, ecs_generated_version, out_dir)
77-
if args.include or args.subset or args.exclude:
77+
if (args.include or args.subset or args.exclude) and not args.force_docs:
7878
exit()
7979

8080
ecs_helpers.make_dirs(docs_dir)
@@ -102,6 +102,8 @@ def argument_parser():
102102
help='enforce strict checking at schema cleanup')
103103
parser.add_argument('--intermediate-only', action='store_true',
104104
help='generate intermediary files only')
105+
parser.add_argument('--force-docs', action='store_true',
106+
help='generate ECS docs even if --subset, --include, or --exclude are set')
105107
args = parser.parse_args()
106108
# Clean up empty include of the Makefile
107109
if args.include and [''] == args.include:

0 commit comments

Comments
 (0)