Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add composable index templates artifacts #1156

Merged
merged 28 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9624d76
Small bugfix when no --include (not even [])
Nov 25, 2020
9c342f9
Sort the imports
Nov 26, 2020
6003841
Initial implementation, generating only the component templates
Nov 26, 2020
9ca0276
Reorganize the code specific to each approach...
Nov 26, 2020
8210eb7
Extract mapping_settings and template_settings to reusable functions
Nov 26, 2020
871b9c4
Move the _meta version to the template level.
Nov 26, 2020
2e2c8a9
Generate sample composable template that doesn't pull in anything yet
Nov 26, 2020
cd5de71
Fill in the component names the sample template is composed of
Nov 26, 2020
5f22b96
Adjust the version for experimental artifacts
Nov 26, 2020
996fad9
code format
Nov 26, 2020
e58ad8a
Drop that field limit
Nov 26, 2020
44bac6c
Fix nesting of the settings and mappings section in the composable te…
Nov 26, 2020
64aff3f
Bash instructions to load the component templates and optionally the …
Nov 26, 2020
6d34541
How to compose templates
Nov 26, 2020
49a56c0
Adjust the newness warning
Nov 26, 2020
9372078
Note: Available for ECS 1.7 or newer only
Nov 26, 2020
ec3bf50
Don't generate component templates for field sets only meant to nest …
Nov 26, 2020
0e1d75d
Add reference URL to the component templates. This one's for @a03nikki
Nov 26, 2020
5d37d99
Changelog
Nov 26, 2020
b59c2ad
Merged #1171 changes, which touched some of the same code:
Dec 8, 2020
85a825c
Rebuild artifacts for newly merged host metrics & multi-user
Dec 8, 2020
4407565
Fix typo
webmat Dec 8, 2020
6f47df1
Rewrite the pointer to the ES templates in generated/README
Dec 8, 2020
b0cd15a
Rewrite bullet points:
Dec 8, 2020
511413f
Adjust links a tad
Dec 8, 2020
1297cd4
Emphasis mine ⛏
Dec 8, 2020
41551a6
Better explain how to interpret the templates
Dec 8, 2020
fa0fc76
Remove one of the two ways of saying 'also'
Dec 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Thanks, you're awesome :-) -->
* Added support in the generated Go source go for `wildcard`, `version`, and `constant_keyword` data types. #1050
* Added support for marking fields, field sets, or field reuse as beta in the documentation. #1051
* Added support for `constant_keyword`'s optional parameter `value`. #1112
* Added component templates for ECS field sets. #1156

#### Improvements

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ check-license-headers:
# Clean deletes all temporary and generated content.
.PHONY: clean
clean:
rm -rf build
rm -rf build generated/elasticsearch/component experimental/generated/elasticsearch/component
# Clean all markdown files for use-cases
find ./use-cases -type f -name '*.md' -not -name 'README.md' -print0 | xargs -0 rm --

Expand Down
6 changes: 3 additions & 3 deletions experimental/generated/elasticsearch/7/template.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"_meta": {
"version": "2.0.0-dev+exp"
},
"index_patterns": [
"try-ecs-*"
],
"mappings": {
"_meta": {
"version": "2.0.0-dev+exp"
},
"date_detection": false,
"dynamic_templates": [
{
Expand Down
43 changes: 43 additions & 0 deletions experimental/generated/elasticsearch/component/agent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"_meta": {
"documentation": "https://www.elastic.co/guide/en/ecs/current/ecs-agent.html",
"ecs_version": "2.0.0-dev+exp"
},
"template": {
"mappings": {
"properties": {
"agent": {
"properties": {
"build": {
"properties": {
"original": {
"type": "wildcard"
}
}
},
"ephemeral_id": {
"ignore_above": 1024,
"type": "keyword"
},
"id": {
"ignore_above": 1024,
"type": "keyword"
},
"name": {
"ignore_above": 1024,
"type": "keyword"
},
"type": {
"ignore_above": 1024,
"type": "keyword"
},
"version": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
}
}
}
}
26 changes: 26 additions & 0 deletions experimental/generated/elasticsearch/component/base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"_meta": {
"documentation": "https://www.elastic.co/guide/en/ecs/current/ecs-base.html",
"ecs_version": "2.0.0-dev+exp"
},
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"labels": {
"type": "object"
},
"message": {
"norms": false,
"type": "text"
},
"tags": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
}
}
171 changes: 171 additions & 0 deletions experimental/generated/elasticsearch/component/client.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
{
"_meta": {
"documentation": "https://www.elastic.co/guide/en/ecs/current/ecs-client.html",
"ecs_version": "2.0.0-dev+exp"
},
"template": {
"mappings": {
"properties": {
"client": {
"properties": {
"address": {
"ignore_above": 1024,
"type": "keyword"
},
"as": {
"properties": {
"number": {
"type": "long"
},
"organization": {
"properties": {
"name": {
"fields": {
"text": {
"norms": false,
"type": "text"
}
},
"type": "wildcard"
}
}
}
}
},
"bytes": {
"type": "long"
},
"domain": {
"type": "wildcard"
},
"geo": {
"properties": {
"city_name": {
"ignore_above": 1024,
"type": "keyword"
},
"continent_name": {
"ignore_above": 1024,
"type": "keyword"
},
"country_iso_code": {
"ignore_above": 1024,
"type": "keyword"
},
"country_name": {
"ignore_above": 1024,
"type": "keyword"
},
"location": {
"type": "geo_point"
},
"name": {
"type": "wildcard"
},
"region_iso_code": {
"ignore_above": 1024,
"type": "keyword"
},
"region_name": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"ip": {
"type": "ip"
},
"mac": {
"ignore_above": 1024,
"type": "keyword"
},
"nat": {
"properties": {
"ip": {
"type": "ip"
},
"port": {
"type": "long"
}
}
},
"packets": {
"type": "long"
},
"port": {
"type": "long"
},
"registered_domain": {
"type": "wildcard"
},
"subdomain": {
"ignore_above": 1024,
"type": "keyword"
},
"top_level_domain": {
"ignore_above": 1024,
"type": "keyword"
},
"user": {
"properties": {
"domain": {
"ignore_above": 1024,
"type": "keyword"
},
"email": {
"type": "wildcard"
},
"full_name": {
"fields": {
"text": {
"norms": false,
"type": "text"
}
},
"type": "wildcard"
},
"group": {
"properties": {
"domain": {
"ignore_above": 1024,
"type": "keyword"
},
"id": {
"ignore_above": 1024,
"type": "keyword"
},
"name": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"hash": {
"ignore_above": 1024,
"type": "keyword"
},
"id": {
"ignore_above": 1024,
"type": "keyword"
},
"name": {
"fields": {
"text": {
"norms": false,
"type": "text"
}
},
"type": "wildcard"
},
"roles": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
}
}
}
}
}
}
72 changes: 72 additions & 0 deletions experimental/generated/elasticsearch/component/cloud.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"_meta": {
"documentation": "https://www.elastic.co/guide/en/ecs/current/ecs-cloud.html",
"ecs_version": "2.0.0-dev+exp"
},
"template": {
"mappings": {
"properties": {
"cloud": {
"properties": {
"account": {
"properties": {
"id": {
"ignore_above": 1024,
"type": "keyword"
},
"name": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"availability_zone": {
"ignore_above": 1024,
"type": "keyword"
},
"instance": {
"properties": {
"id": {
"ignore_above": 1024,
"type": "keyword"
},
"name": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"machine": {
"properties": {
"type": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"project": {
"properties": {
"id": {
"ignore_above": 1024,
"type": "keyword"
},
"name": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"provider": {
"ignore_above": 1024,
"type": "keyword"
},
"region": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
}
}
}
}
43 changes: 43 additions & 0 deletions experimental/generated/elasticsearch/component/container.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"_meta": {
"documentation": "https://www.elastic.co/guide/en/ecs/current/ecs-container.html",
"ecs_version": "2.0.0-dev+exp"
},
"template": {
"mappings": {
"properties": {
"container": {
"properties": {
"id": {
"ignore_above": 1024,
"type": "keyword"
},
"image": {
"properties": {
"name": {
"ignore_above": 1024,
"type": "keyword"
},
"tag": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"labels": {
"type": "object"
},
"name": {
"ignore_above": 1024,
"type": "keyword"
},
"runtime": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
}
}
}
}
Loading