-
Notifications
You must be signed in to change notification settings - Fork 72
/
manifest.spec.yml
627 lines (613 loc) · 23.1 KB
/
manifest.spec.yml
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
##
## Describes the specification for a data stream's manifest.yml file
##
spec:
# Everything under here follows JSON schema (https://json-schema.org/), written as YAML for readability
type: object
additionalProperties: false
definitions:
# Would like to use `null` type for an empty array which is a valid value
# Need to use `"null"` to workaround a bug in the YAML parser implementation (`[]interface(nil)` is just `nil`)
# For reference: https://github.com/xeipuuv/gojsonschema/issues/141
input_variable_value:
anyOf:
- type:
- string
- integer
- boolean
- "null"
- type: array
items:
$ref: "#/definitions/input_variable_value"
examples:
- "null"
- ""
- some string
- 1234
- true
- - 3
- mixed
- true
- - - array
- 1
- - array
- 2
vars:
description: Input variables.
type: array
items:
type: object
additionalProperties: false
properties:
name:
description: Variable name.
type: string
examples:
- hosts
type:
description: Data type of variable.
type: string
enum:
- bool
- email
- integer
- password
- select
- text
- textarea
- time_zone
- url
- yaml
examples:
- text
title:
description: Title of variable.
type: string
examples:
- Hosts
description:
description: Short description of variable.
type: string
examples:
- "Hosts of integration service to connect to"
multi:
description: Can variable contain multiple values?
type: boolean
default: false
examples:
- true
options: true # This allows options to be required when type is select.
required:
description: Is variable required?
type: boolean
default: false
examples:
- true
secret:
description: >
Specifying that a variable is secret means that Kibana will store the value
separate from the package policy in a more secure index.
This is useful for passwords and other sensitive information.
One caveat is that secrets are write-only, once a user writes a secret var
they cannot read it again, only overwrite it.
type: boolean
default: false
examples:
- true
show_user:
description: Should this variable be shown to the user by default?
type: boolean
default: true
examples:
- false
hide_in_deployment_modes:
description: >
Whether this variable should be hidden in the UI for agent policies intended
to some specific deployment modes.
type: array
items:
type: string
enum:
- default
- agentless
url_allowed_schemes:
description: >
List of allowed URL schemes for the url type. If empty, any scheme is allowed.
An empty string can be used to indicate that the scheme is not mandatory.
type: array
items:
type: string
default: []
examples:
- ['http', 'https']
- ['redis', 'rediss']
- ['', 'mysql']
default:
description: Default value(s) for variable
$ref: "#/definitions/input_variable_value"
allOf:
- if:
properties:
type:
const: select
then:
required:
- options
properties:
options:
description: List of options for select type
type: array
items:
type: object
additionalProperties: false
properties:
value:
type: string
examples:
- node
- cluster
text:
type: string
examples:
- node
- cluster
required:
- value
- text
min_items: 1
else:
not:
required:
- options
- if:
anyOf:
- allOf:
- properties:
name:
pattern: "(access_key|api_key|passphrase|password|secret|token)"
- not:
properties:
name:
pattern: "(_file|_url)$"
- properties:
type:
const: password
then:
required:
- secret
required:
- name
- type
elasticsearch_index_template:
description: Index template definition
type: object
additionalProperties: false
properties:
settings:
description: Settings section of index template
type: object
additionalProperties: false
properties:
analysis:
type: object
additionalProperties: false
properties:
analyzer:
description: Definition of custom analyzer.
type: object
additionalProperties:
type: object
additionalProperties: false
properties:
type:
description: Type of analyzer
type: string
enum:
- pattern
pattern:
type: string
index:
type: object
additionalProperties: false
properties:
codec:
description: >
Type of compression to use. The default is to use LZ4, `best_compression` uses DEFLATE,
with higher compression but lower ingestion performance.
type: string
enum:
- default
- best_compression
mapping:
type: object
additionalProperties: false
patternProperties:
"^(dimension|nested|total)_fields$":
type: object
additionalProperties: false
properties:
limit:
description: Limit on the number of fields of this kind on this data stream.
type: integer
sort:
type: object
additionalProperties: false
properties:
field:
description: Fields used to sort the document in the Lucene segments.
oneOf:
- type: string
- type: array
items:
type: string
order:
description: The sort order to use for each field.
oneOf:
- type: string
enum:
- asc
- desc
- type: array
items:
type: string
enum:
- asc
- desc
number_of_shards:
description: Number of primary shards that the data stream should have.
type: integer
minimum: 1
default: 1
mappings:
description: Mappings section of index template
type: object
additionalProperties: false
properties:
date_detection:
description: >
If true, new string fields will be checked to see if their contents match with `dynamic_date_formats`.
If they do, the field is dynamically added with type `date`. Set to false to disable this feature.
type: boolean
dynamic:
description: >
Control if new fields can be added dynamically. When set to `false`, new fields are not indexed.
When set to `strict`, fields must be explicitly added to the mapping. With `runtime`, fields are
not indexed, but added as runtime fields. Defaults to `true`, where Elasticsearch tries to index
any new field.
oneOf:
- type: boolean
- type: string
enum:
- runtime
- strict
dynamic_date_formats:
# Added to support `date_detection`, but usually `date_detection` is only used to disable it.
description: Custom date formats to use for date detection.
type: array
items:
type: string
examples:
- ["strict_date_optional_time","yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"] # This is the default if not set.
- ["MM/dd/yyyy"]
dynamic_templates:
type: array
items:
type: object
maxProperties: 1
additionalProperties:
type: object
additionalProperties: false
properties:
# path_match: false # Dynamic mappings with path match can be defined in fields definitions.
match_mapping_type:
oneOf:
- type: boolean
- type: string
enum:
- "null"
- "true"
- "false"
- double
- long
- string
- object
- array
mapping:
type: object
additionalProperties: false
properties:
type:
$ref: "./fields/fields.spec.yml#/items/properties/type"
scaling_factor:
$ref: "./fields/fields.spec.yml#/items/properties/scaling_factor"
metrics:
$ref: "./fields/fields.spec.yml#/items/properties/metrics"
default_metric:
$ref: "./fields/fields.spec.yml#/items/properties/default_metric"
ignore_above:
$ref: "./fields/fields.spec.yml#/items/properties/ignore_above"
index:
$ref: "./fields/fields.spec.yml#/items/properties/index"
patternProperties:
# Exception for fields imported by elastic-package when import_mappings is used.
# TODO: Allow this only on built packages.
"^_embedded_ecs":
type: object
additionalProperties: false
properties:
path_match:
type: string
path_unmatch:
type: string
match:
type: string
match_mapping_type:
$ref: "#/definitions/elasticsearch_index_template/properties/mappings/properties/dynamic_templates/items/additionalProperties/properties/match_mapping_type"
mapping:
type: object
additionalProperties: false
properties:
doc_values:
$ref: "./fields/fields.spec.yml#/items/properties/doc_values"
fields:
type: object
minProperties: 1
additionalProperties:
$ref: "#/definitions/elasticsearch_index_template/properties/mappings/properties/dynamic_templates/items/patternProperties/^_embedded_ecs/properties/mapping"
ignore_malformed:
$ref: "./fields/fields.spec.yml#/items/properties/ignore_malformed"
index:
$ref: "./fields/fields.spec.yml#/items/properties/index"
scaling_factor:
$ref: "./fields/fields.spec.yml#/items/properties/scaling_factor"
type:
$ref: "./fields/fields.spec.yml#/items/properties/type"
subobjects:
description: >
Turn the support for subobjects on or off in the mapping
configuration for the data stream.
By default, it's set to `true`, enabling Elasticsearch to
expands fields that contain dots in their names
to their corresponding object structure.
Setting it to `false` restricts objects
from holding subobjects, enabling storing documents
with dot-contained field names and common prefixes.
It is still possible to send documents that have
objects to a data stream that has set subobjects
to `false`.
Example when the subobjects mapping option is `false`:
PUT my-index-000001
{
"mappings": {
"subobjects": false
}
}
PUT my-index-000001/_doc/metric_1
{
"time" : "100ms",
"time.min" : "10ms",
"time.max" : "900ms"
}
Before disabling subobjects, consider the following implications:
- Nested field types cannot be used in data streams.
- The subobjects mapping definition is immutable.
- This setting depends on auto-flattening mappings,
which comes with limitations [^1] for integration
and custom mappings in data streams without
subobjects.
- Auto-flattening is available starting from version
8.14, integrations must be on at least this
version.
For comprehensive details on subobjects, refer to
the Elasticsearch documentation [^2].
[^1]: Auto-flattening limitations are documented at:
https://www.elastic.co/guide/en/elasticsearch/reference/master/subobjects.html#_auto_flattening_object_mappings
[^2]: Elasticsearch documentation on subobjects:
https://www.elastic.co/guide/en/elasticsearch/reference/current/subobjects.html
type: boolean
default: true
ingest_pipeline:
description: Elasticsearch ingest pipeline settings
type: object
additionalProperties: false
properties:
name:
description: Ingest pipeline name
type: string
required:
- name
data_stream:
description: Data stream section of index template
type: object
additionalProperties: false
properties:
hidden:
description: Makes the data stream hidden
type: boolean
properties:
dataset:
description: Name of data set.
type: string
title:
description: >
Title of data stream. It should include the source of the data that is
being collected, and the kind of data collected such as logs or metrics.
Words should be uppercased.
type: string
examples:
- AWS Billing Metrics
- Linux Metrics
- User Activity Logs
release:
description: Stability of data stream.
type: string
enum:
- experimental
- beta
examples:
- beta
ilm_policy:
description: The name of an existing ILM (Index Lifecycle Management) policy
type: string
examples:
- diagnostics
dataset_is_prefix:
description: if true, the index pattern in the ES template will contain the dataset as a prefix only
type: boolean
default: false
type:
description: Type of data stream
type: string
enum:
- metrics
- logs
- synthetics
- traces
- profiling # Technical preview.
examples:
- metrics
hidden:
description: >
Specifies if a data stream is hidden, resulting in dot prefixed system indices.
To set the data stream hidden without those dot prefixed indices, check `elasticsearch.index_template.data_stream.hidden` flag.
type: boolean
deprecated: true # https://github.com/elastic/package-spec/issues/464
streams:
description: Streams offered by data stream.
type: array
items:
type: object
additionalProperties: false
properties:
input:
type: string
examples:
- aws/metrics
- s3
- file
title:
description: >
Title of the stream. It should include the source of the data that is
being collected, and the kind of data collected such as logs or metrics.
Words should be uppercased.
type: string
examples:
- AWS Billing Metrics
- Linux Metrics
- User Activity Logs
description:
description: >
Description of the stream. It should describe what is being collected and
with what collector, following the structure "Collect X from Y with X".
type: string
examples:
- Collect Metrics from AWS Billing service using Elastic Agent.
- Collect Metrics from Linux servers with Elastic Agent.
- Collect Logs from Apache Web Server using Elastic Agent.
template_path:
description: "Path to Elasticsearch index template for stream."
type: string
vars:
$ref: "#/definitions/vars"
enabled:
description: Is stream enabled?
type: boolean
required:
- title
- description
- input
agent:
$ref: "../../integration/manifest.spec.yml#/definitions/agent"
elasticsearch:
description: Elasticsearch asset definitions
type: object
additionalProperties: false
properties:
index_mode:
description: |-
Index mode to use. Index mode can be used to enable use case specific functionalities.
This setting must be installed in the composable index template, not in the package component templates.
type: string
enum:
- "time_series" # Enables time series data streams https://www.elastic.co/guide/en/elasticsearch/reference/master/tsds.html
examples:
- "time_series"
index_template:
$ref: "#/definitions/elasticsearch_index_template"
privileges:
description: Elasticsearch privilege requirements
type: object
additionalProperties: false
properties:
indices:
description: Elasticsearch index privilege requirements
type: array
items:
type: string
source_mode:
description: |-
Source mode to use. This configures how the document source (`_source`) is stored
for this data stream.
If configured as `default`, this mode is not configured and it uses Elasticsearch defaults.
If configured as `synthetic`, it enables [synthetic source](https://www.elastic.co/guide/en/elasticsearch/reference/8.4/mapping-source-field.html#synthetic-source),
that doesn't store the source, but tries to rebuild it from the indexed fields when queried.
If no configured or set to `synthetic`, users may override the setting from Fleet UI.
type: string
enum:
- "default"
- "synthetic"
examples:
- "synthetic"
dynamic_dataset:
description: When set to true, agents running this integration are granted data stream privileges for all datasets of its type
type: boolean
dynamic_namespace:
description: When set to true, agents running this integration are granted data stream privileges for all namespaces of its type
type: boolean
required:
- title
# JSON patches for newer versions should be placed on top
versions:
- before: 3.2.0
patch:
# Does not allow to hide variables in default mode till this version.
- op: remove
path: /definitions/vars/items/properties/hide_in_deployment_modes/items/enum/0
- op: remove
path: /definitions/elasticsearch_index_template/properties/mappings/properties/subobjects
- before: 3.1.4
patch:
- op: remove
path: /definitions/vars/items/properties/hide_in_deployment_modes
- before: 3.0.2
patch:
# Required secret for variables that look like secrets.
- op: remove
path: /definitions/vars/items/allOf/1
- before: 3.0.0
patch:
# Stricter validation of elasticsearch settings and mappings.
- op: remove
path: /definitions/elasticsearch_index_template/properties/settings/additionalProperties
- op: remove
path: /definitions/elasticsearch_index_template/properties/settings/properties
- op: remove
path: /definitions/elasticsearch_index_template/properties/mappings/additionalProperties
- op: remove
path: /definitions/elasticsearch_index_template/properties/mappings/properties
- before: 2.12.0
patch:
- op: remove
path: /properties/agent
- before: 2.9.0
patch:
- op: remove
path: /definitions/vars/items/properties/secret
- before: 2.7.0
patch:
- op: remove
path: /properties/type/enum/4
- before: 2.6.0
patch:
- op: remove
path: /definitions/vars/items/properties/type/enum/4