-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathupdate_major_package_spec.md
298 lines (226 loc) · 11.2 KB
/
update_major_package_spec.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# Update between Package Spec major versions
Each Package Spec major version may bring breaking changes or additional
validations that may make tests to fail for some packages. Find here guidelines
about how to fix these issues.
Version of the Package Spec used by a package is defined by the `format_version`
setting in the `manifest.yml` file.
## Troubleshooting upgrades to Package Spec v3
### Error: building package failed: resolving external fields failed: can't resolve fields: field ... cannot be reused at top level
Some ECS fields include a reusability condition, so they can be reused on other
objects also defined in ECS. Some of these fields explicitly allow to reuse the
fields in the top level, while others explicitly disallow it.
Previous versions of elastic-package allowed to import reusable fields from ECS
at the top level in all cases, what shouldn't be always allowed.
If after updating to Package Spec v3 you find this error, please do the
following:
1. Check if your package is actually using this field.
2. If it is not using it, please remove it, and you are done.
3. If it is using it, copy the definition from ECS, or from the zip of a
previous build of the package.
4. Consider moving the field to an ECS field if there is a suitable one. You
may need to duplicate the field for some time to avoid breaking changes.
For example, `geo` fields are not expected to be used in the top level. If any
of your integrations is doing it, please check to what location this field
refers to. If it refers to the location of the host running elastic-agent, these
fields could be under `host.geo`. If they refer to the client side of a
connection, you could use `client.geo`.
### field ...: Additional property ... is not allowed
Package Spec 3.0.0 doesn't allow to use dotted notation in yaml configuration in
manifests. Previous implementation could lead to ambiguous results if the same
setting was included with and withoud dotted notation.
This is commonly found in `conditions` or in `elasticsearch` settings.
`elastic-package` `check` and `format` subcommands will try to fix this
automatically. If you are still finding this issue, you will need to fix it
manually. For that, please use nested dotations. So if for example your package
has something like the following:
```
conditions:
elastic.subscription: basic
```
Transform it to the following:
```
conditions:
elastic:
subscription: basic
```
### file "..." is invalid: dangling reference found: ...
Package Spec 3.0.0 has stricter validation for some Kibana objects now. It
checks if all references included are defined in the own package.
Please remove or fix any reference to missing objects.
### field processors...: Additional property ... is not allowed
Some ingest pipeline processors are not well supported in the current Package
Spec, or there are alternative preferred ways to define them. These processors
won't be allowed to prevent other issues and have more consistent user
experience for some features.
If you find this error while trying to use the `reroute` processor, please use
instead the `routing_rules.yml` file, so users can more easily customize the
routing rules.
If you find this error while trying to use a new processor, please open an issue
in the Package Spec repository so we can add support for it.
### field owner: type is required
Package Spec 3.0.0 now requires the owner type field to be set. This field
describes who owns the package and the level of support that is provided.
The 'elastic' value indicates that the package is built and maintained by
Elastic. The 'partner' value indicates that the package is built and
maintained by a partner vendor and may include involvement from Elastic.
The 'community' value indicates the package is built and maintained by
non-Elastic community members.
The field was initially introduced in Package Spec `2.11.0` and prior to this
version assumed an implicit default of `elastic`. In `2.11.0`, the implicit
default changed to `community`. To avoid accidentally tagging an integration
with the wrong owner type, the field is now required.
The value must be one of the following:
- `elastic`
- `partner`
- `community`
```
owner:
type: elastic
```
### expected filter in dashboard: ...
It is required to include filters in dashboards, to limit the size of the data
handled to the one included in related datasets.
To fix this issue, please include a filter in the dashboard. It usually means to
add a filter based on `data_stream.dataset`. But it is open to the package
developer to provide any filter that fits the use case of the package.
There are two variants of this error:
- `no filter found`: that means that no kind of filter has been found in the
dashboard, and one should be added.
- `saved query found, but no filter`: that means that a saved query has been
found, but no filter. If that's the case, please migrate the saved query to a
filter. We want to make this filtering only in filters, for consistency
between different dashboards, and to allow users to quickly filter using the
query bar without affecting the provided filters.
### "My Dashboard" contains legacy visualization: "My Visualization" (metric, TSVB)
All visualizations must be created using [Lens](https://www.elastic.co/kibana/kibana-lens) or [Vega](https://www.elastic.co/guide/en/kibana/current/vega.html).
The only exceptions are
- Markdown panels created from the dashboard application. There are no plans to deprecate these.
- TSVB markdown. Support will eventually be removed, but this is
currently allowed because we do not yet offer an alternative for
injecting analytics into markdown. Prefer the dashboard markdown
panels when possible.
- The legacy dashboard controls ("input-control-vis"). These should be replaced
with the [new dashboard controls](https://www.elastic.co/guide/en/kibana/current/add-controls.html) but we are not currently
enforcing this with tooling.
**Note:** most legacy visualizations can be converted by selecting "Convert to Lens"
from the dashboard panel context menu or by clicking "Edit visualization in Lens"
after opening the visualization in the editor.
## Troubleshooting upgrades to Package Spec v2
### field (root): Additional property license is not allowed
The `license` field was deprecated in Package Spec 1.13.0 and removed in 2.0.0.
This field was used to indicate the required subscription. The `elastic.subscription`
condition should be used instead.
So, for example, for a package with `license: basic`, you must remove this line
and add the following condition:
```
conditions:
elastic:
subscription: basic
```
### field ...: Additional property ... is not allowed
Validation of properties on fields definitions is stricter now. If you see any
error about properties not allowed in fields definitions, this probably means
one of these two things:
- There is a typo, please check that this is the property you wanted to use.
- The property is not supported, then you should probably remove it. If you think
that the property should be supported, please [open an issue](https://github.com/elastic/package-spec/issues/new?assignees=&labels=discuss&template=Change_Proposal.md&title=%5BChange+Proposal%5D+)
Some of the non-supported commonly used properties are `required`, `release` or
`overwrite`.
### field ... is not normalized as expected: expected array, found ...
ECS fields can indicate normalization rules. `elastic-package` checks that they
are followed in test documents.
To solve this, modify the ingest pipeline of the package to produce an array
instead of single values. This is needed even when the field is only going to
store a single value.
This only affects how the data is represented in the source documents, it
doesn't affect how the data can be queried.
For example the following processor:
```
- set:
field: event.category
value: "web"
```
Should be replaced with:
```
- set:
field: event.category
value: ["web"]
```
### field "event.type" value ... is not one of the expected values (...) for ...
Some ECS fields can add restrictions on the values that `event.type` can have.
So when using any of these fields, the values of `event.type` must be aligned
with the expected values.
To solve this, ensure that the generated documents have the `event.type` set to
some of the expected values.
For example if a document contains `event.category: web`, the value of
`event.type` must be `access`, `error` or `info` according to ECS 8.4.
### field "event.dataset" should have value ..., it has ...
The fields `event.dataset` and `data_stream.dataset` should contain the name of
the package and the name of the data stream that generates it, separated by a
dot. For example for documents of the "access" data stream of the Apache module,
it should be `apache.access`.
If these fields are not being correctly populated, look for the source of the
value.
If it is a constant keyword, review the configured value.
```
- name: event.dataset
type: constant_keyword
external: ecs
value: "apache.access"
```
If the value comes with an unexpected value from the collector, you can override
it in the pipeline:
```
- set:
field: event.dataset
value: "apache.access"
```
Changing the value of `event.dataset` can be considered a breaking change, take
this into account in your package when adding the changelog entry.
### field ...type: ...type must be one of the following:...
This happens when a field doesn't have one of the allowed types. In Package Spec
2.0.0 we are removing the `array` data type. The reason is that this cannot be
mapped to any data type in Elasticsearch, and an invalid configuration can lead
to an invalid mapping.
Any Elasticsearch field can contain any number of values of the same type, and
this is what is expected in most of the cases when using the `array` type.
If you are using something like the following definition:
```
- name: ciphersuites
type: array
```
You should be using something like this:
```
- name: ciphersuites
type: keyword
```
If you were using `object_type` to define the type of the elements in the array,
like this:
```
- name: ciphersuites
type: array
object_type: keyword
```
You can instead use the object type directly as type:
```
- name: ciphersuites
type: keyword
```
### Invalid field ilm_policy
Package Spec 2.0.0 will include additional validations on the `ilm_policy` field of
the data streams manifest. These validations aim to ensure that the ILM policy
is defined in the data stream, so the package is self-contained.
If you find errors related to this field, it can be caused by a typo, or because
the policy is missing. The error message will describe the expected values.
To solve this error, check that the value of `ilm_policy` follows the pattern:
```
{data stream type}-{package name}.{data stream name}-{ilm file name without extension}
```
And an ILM policy definition exists in:
```
./data_streams/{data stream name}/elasticsearch/ilm/{ilm file name without extension}.json
```
It could be the case that you are trying to reference to an ILM policy defined
in some other place out of the package. This is not supported. If you have a use
case for this, please [open an issue](https://github.com/elastic/package-spec/issues/new?assignees=&labels=discuss&template=Change_Proposal.md&title=%5BChange+Proposal%5D+)
for discussion.