Skip to content

Commit 8e07ee6

Browse files
docs, update tests
1 parent ed1b477 commit 8e07ee6

File tree

10 files changed

+94
-2
lines changed

10 files changed

+94
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ to [JSON Schema](https://json-schema.org/), but with a couple of differences:
6868

6969
Expected package files, e.g. `manifest.yml` themselves have a structure to their contents. This structure is described in specification files using JSON schema (this is point 2. above). These specification files are also written as YAML for readability.
7070

71-
Note that the specification files primarily define the structure (syntax) of a package's contents. To a limited extent they may also define some semantics, e.g. enumeration values for certain fields. Richer semantics, however, will need to be expressed as validation code.
71+
Note that the specification files primarily define the structure (syntax) of a package's contents. To a limited extent they may also define some semantics, e.g. enumeration values for certain fields. Richer semantics, however, will need to be expressed as [validation code](docs/validations.md).
7272

7373
# Specification Versioning
7474

docs/validations.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Validation Codes
2+
3+
| Validation | Short description |
4+
|---------------------|---------------------------------------|
5+
| **[JSE][JSE00001]** | **JSON Schema Errors** |
6+
| [JSE00001] | Rename message to event.original |
7+
| **[PSR][PSR00001]** | **Package Spec Rule** |
8+
| [PSR00001] | Non GA spec used in GA package |
9+
| [PSR00002] | Prerelease feature used in GA package |
10+
| **[SVR][SVR00001]** | **Semantic Validation Rules** |
11+
| [SVR00001] | Dashboard with query but no filter |
12+
| [SVR00002] | Dashboard without filter |
13+
| [SVR00003] | Dangling object IDs |
14+
| [SVR00004] | Visualization by value |
15+
| [SVR00005] | Minimum Kibana version |
16+
| [SVR00006] | Processor tag is required |
17+
| [SVR00007] | Processor tag duplicated in pipeline |
18+
19+
## JSE00001 - Rename message to event.original
20+
[JSE00001]: #jse00001---rename-message-to-eventoriginal
21+
22+
**Available since [3.1.0](https://github.com/elastic/package-spec/releases/tag/v3.1.0)**
23+
24+
## PSR00001 - Non GA spec used in GA package
25+
[PSR00001]: #psr00001---non-ga-spec-used-in-ga-package
26+
27+
**Available since [3.0.1](https://github.com/elastic/package-spec/releases/tag/v3.0.1)**
28+
29+
## PSR00002 - Prerelease feature used in GA package
30+
[PSR00002]: #psr00002---prerelease-feature-used-in-ga-package
31+
32+
**Available since [3.0.0](https://github.com/elastic/package-spec/releases/tag/v3.0.0)**
33+
34+
## SVR00001 - Dashboard with query but no filter
35+
[SVR00001]: #svr00001---dashboard-with-query-but-no-filter
36+
37+
**Available since [2.13.0](https://github.com/elastic/package-spec/releases/tag/v2.13.0)**
38+
39+
## SVR00002 - Dashboard without filter
40+
[SVR00002]: #svr00002---dashboard-without-filter
41+
42+
**Available since [2.13.0](https://github.com/elastic/package-spec/releases/tag/v2.13.0)**
43+
44+
## SVR00003 - Dangling object IDs
45+
[SVR00003]: #svr00003---dangling-object-ids
46+
47+
**Available since [2.13.0](https://github.com/elastic/package-spec/releases/tag/v2.13.0)**
48+
49+
## SVR00004 - Visualization by value
50+
[SVR00004]: #svr00004---visualization-by-value
51+
52+
**Available since [3.0.0](https://github.com/elastic/package-spec/releases/tag/v3.0.0)**
53+
54+
## SVR00005 - Minimum Kibana version
55+
[SVR00005]: #svr00005---minimum-kibana-version
56+
57+
**Available since [3.0.0](https://github.com/elastic/package-spec/releases/tag/v3.0.0)**
58+
59+
## SVR00006 - Processor tag is required
60+
[SVR00006]: #svr00006---processor-tag-is-required
61+
62+
**Available since [3.6.0](https://github.com/elastic/package-spec/releases/tag/v3.6.0)**
63+
64+
Every processor in an ingest pipeline must include a unique tag, which is used to
65+
annotate the processor in metrics and logs.
66+
67+
```yaml
68+
set:
69+
tag: set_event_category
70+
field: event.category
71+
value: [network]
72+
```
73+
74+
## SVR00007 - Processor tag duplicated in pipeline
75+
[SVR00007]: #svr00007---processor-tag-duplicated-in-pipeline
76+
77+
**Available since [3.6.0](https://github.com/elastic/package-spec/releases/tag/v3.6.0)**
78+
79+
A processor tag must not be repeated in an ingest pipeline. A tag must uniquely
80+
identify a processor in a pipeline so it can be annotated in metrics and logs.

test/packages/good_v3/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
- version: 1.1.0
2+
changes:
3+
- description: Add processor tags
4+
type: enhancement
5+
link: https://github.com/elastic/package-spec/pull/1010
16
- version: 1.0.1
27
changes:
38
- description: Add kibana configuration links

test/packages/good_v3/data_stream/agent_settings/elasticsearch/ingest_pipeline/default.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
description: Pipeline for processing sample logs
33
processors:
44
- set:
5+
tag: set_sample_field
56
field: sample_field
67
value: "1"
78
on_failure:

test/packages/good_v3/data_stream/ecs_import_mappings/elasticsearch/ingest_pipeline/default.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
description: Pipeline for processing sample logs
33
processors:
44
- set:
5+
tag: set_sample_field
56
field: sample_field
67
value: "1"
78
on_failure:

test/packages/good_v3/data_stream/foo/elasticsearch/ingest_pipeline/default.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ description: Pipeline for Microsoft DHCP
33

44
processors:
55
- rename:
6+
tag: rename_foo_to_message
67
field: foo
78
target_field: message
89
ignore_missing: true

test/packages/good_v3/data_stream/rename_message/elasticsearch/ingest_pipeline/default.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ description: Test pipeline with renaming processor
33
processors:
44
# cf. https://github.com/elastic/integrations/pull/7026/files#diff-dafc5693f21abb74b294987b502cdc5770f22cccff3c5a8fee0d48510791b811
55
- rename:
6+
tag: rename message_to_event_original
67
field: message
78
target_field: event.original
89
ignore_missing: true
910
if: 'ctx.event?.original == null'
1011
description: 'Renames the original `message` field to `event.original` to store a copy of the original message. The `event.original` field is not touched if the document already has one; it may happen when Logstash sends the document.'
1112
- remove:
13+
tag: remove_message
1214
field: message
1315
ignore_missing: true
1416
if: 'ctx.event?.original != null'

test/packages/good_v3/data_stream/root/elasticsearch/ingest_pipeline/default.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
description: Pipeline for processing sample logs
33
processors:
44
- set:
5+
tag: set_sample_field
56
field: sample_field
67
value: "1"
78
on_failure:

test/packages/good_v3/data_stream/routing_rules/elasticsearch/ingest_pipeline/default.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
description: Pipeline for processing sample logs
33
processors:
44
- set:
5+
set: sample_field
56
field: sample_field
67
value: "1"
78
on_failure:

test/packages/good_v3/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ format_version: 3.6.0
22
name: good_v3
33
title: Good package
44
description: This package is good for format version 3
5-
version: 1.0.1
5+
version: 1.1.0
66
type: integration
77
source:
88
license: "Apache-2.0"

0 commit comments

Comments
 (0)