kibana/x-pack/plugins/event_log/generated
Garrett Spong ef64acf405
[RAM] Adds revision to event-log (#153716)
## Summary

Follow on from https://github.com/elastic/kibana/pull/151388 &
https://github.com/elastic/kibana/pull/147398, which includes the rule's
current `revision` when writing to the kibana event-log.

Note: Added as `kibana.alert.rule.revision` instead of as ECS field
`rule.version` as the [ECS
docs](https://www.elastic.co/guide/en/ecs/current/ecs-rule.html#field-rule-version)
conflate `version` & `revision` and figured it was best to be explicit.
If we do indeed want to use `rule.version` I'll make the change.


<p align="center">
<img width="500"
src="https://user-images.githubusercontent.com/2946766/233216775-f371f412-dcf6-4ef7-a396-84ec853eebbb.png"
/>
</p> 



### Checklist

Delete any items that are not applicable to this PR.

- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2023-04-21 17:20:26 -07:00
..
mappings.json [RAM] Adds revision to event-log (#153716) 2023-04-21 17:20:26 -07:00
README.md [Event Log] Extend ECS event schema with fields needed for Detection Engine (#95067) 2021-03-29 14:59:36 +02:00
schemas.ts [RAM] Adds revision to event-log (#153716) 2023-04-21 17:20:26 -07:00

Generating event schema

The files in this directory were generated by manually running the script ../scripts/create-schemas.js from the root directory of the repository.

These files should not be edited by hand.

Please follow the following steps:

  1. Clone the ECS repo locally so that it resides along side your kibana repo, and checkout the ECS version you wish to support (for example, the 1.8 branch, for version 1.8).

  2. In the x-pack/plugins/event_log/scripts/mappings.js file you'll want to make the following changes:

    • Update EcsCustomPropertyMappings to include the mapping of the custom fields you wish to add.
    • Update EcsPropertiesToGenerate to include the fields in the generated mappings.json.
    • Make sure to list all array fields in EcsEventLogMultiValuedProperties.
  3. Cd to the kibana root folder and run:

    node ./x-pack/plugins/event_log/scripts/create_schemas.js