Skip to content

Commit 4c1ca7e

Browse files
authored
[AO][SERVERLESS] Fix Custom Threshold rule tests for Serverless (#166942)
## Summary Fixes #165569 Fixes #166617 Fixes #166618 Fixes #166619 Fixes #166620
1 parent 5b0ec2e commit 4c1ca7e

23 files changed

Lines changed: 553 additions & 296 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"_meta": {
3+
"documentation": "https://www.elastic.co/guide/en/ecs/current/ecs-base.html",
4+
"ecs_version": "8.0.0"
5+
},
6+
"template": {
7+
"mappings": {
8+
"properties": {
9+
"@timestamp": {
10+
"type": "date"
11+
},
12+
"labels": {
13+
"type": "object"
14+
},
15+
"message": {
16+
"type": "match_only_text"
17+
},
18+
"tags": {
19+
"ignore_above": 1024,
20+
"type": "keyword"
21+
}
22+
}
23+
}
24+
}
25+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"_meta": {
3+
"documentation": "https://www.elastic.co/guide/en/ecs/current/ecs-event.html",
4+
"ecs_version": "8.0.0"
5+
},
6+
"template": {
7+
"mappings": {
8+
"properties": {
9+
"event": {
10+
"properties": {
11+
"dataset": {
12+
"ignore_above": 1024,
13+
"type": "keyword"
14+
},
15+
"module": {
16+
"ignore_above": 1024,
17+
"type": "keyword"
18+
}
19+
}
20+
}
21+
}
22+
}
23+
}
24+
}
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
{
2+
"_meta": {
3+
"documentation": "https://www.elastic.co/guide/en/ecs/current/ecs-host.html",
4+
"ecs_version": "8.0.0"
5+
},
6+
"template": {
7+
"mappings": {
8+
"properties": {
9+
"host": {
10+
"properties": {
11+
"architecture": {
12+
"ignore_above": 1024,
13+
"type": "keyword"
14+
},
15+
"cpu": {
16+
"properties": {
17+
"usage": {
18+
"scaling_factor": 1000,
19+
"type": "scaled_float"
20+
}
21+
}
22+
},
23+
"disk": {
24+
"properties": {
25+
"read": {
26+
"properties": {
27+
"bytes": {
28+
"type": "long"
29+
}
30+
}
31+
},
32+
"write": {
33+
"properties": {
34+
"bytes": {
35+
"type": "long"
36+
}
37+
}
38+
}
39+
}
40+
},
41+
"domain": {
42+
"ignore_above": 1024,
43+
"type": "keyword"
44+
},
45+
"geo": {
46+
"properties": {
47+
"city_name": {
48+
"ignore_above": 1024,
49+
"type": "keyword"
50+
},
51+
"continent_code": {
52+
"ignore_above": 1024,
53+
"type": "keyword"
54+
},
55+
"continent_name": {
56+
"ignore_above": 1024,
57+
"type": "keyword"
58+
},
59+
"country_iso_code": {
60+
"ignore_above": 1024,
61+
"type": "keyword"
62+
},
63+
"country_name": {
64+
"ignore_above": 1024,
65+
"type": "keyword"
66+
},
67+
"location": {
68+
"type": "geo_point"
69+
},
70+
"name": {
71+
"ignore_above": 1024,
72+
"type": "keyword"
73+
},
74+
"postal_code": {
75+
"ignore_above": 1024,
76+
"type": "keyword"
77+
},
78+
"region_iso_code": {
79+
"ignore_above": 1024,
80+
"type": "keyword"
81+
},
82+
"region_name": {
83+
"ignore_above": 1024,
84+
"type": "keyword"
85+
},
86+
"timezone": {
87+
"ignore_above": 1024,
88+
"type": "keyword"
89+
}
90+
}
91+
},
92+
"hostname": {
93+
"ignore_above": 1024,
94+
"type": "keyword"
95+
},
96+
"id": {
97+
"ignore_above": 1024,
98+
"type": "keyword"
99+
},
100+
"ip": {
101+
"type": "ip"
102+
},
103+
"mac": {
104+
"ignore_above": 1024,
105+
"type": "keyword"
106+
},
107+
"name": {
108+
"ignore_above": 1024,
109+
"type": "keyword"
110+
},
111+
"network": {
112+
"properties": {
113+
"egress": {
114+
"properties": {
115+
"bytes": {
116+
"type": "long"
117+
},
118+
"packets": {
119+
"type": "long"
120+
}
121+
}
122+
},
123+
"ingress": {
124+
"properties": {
125+
"bytes": {
126+
"type": "long"
127+
},
128+
"packets": {
129+
"type": "long"
130+
}
131+
}
132+
}
133+
}
134+
},
135+
"os": {
136+
"properties": {
137+
"family": {
138+
"ignore_above": 1024,
139+
"type": "keyword"
140+
},
141+
"full": {
142+
"fields": {
143+
"text": {
144+
"type": "match_only_text"
145+
}
146+
},
147+
"ignore_above": 1024,
148+
"type": "keyword"
149+
},
150+
"kernel": {
151+
"ignore_above": 1024,
152+
"type": "keyword"
153+
},
154+
"name": {
155+
"fields": {
156+
"text": {
157+
"type": "match_only_text"
158+
}
159+
},
160+
"ignore_above": 1024,
161+
"type": "keyword"
162+
},
163+
"platform": {
164+
"ignore_above": 1024,
165+
"type": "keyword"
166+
},
167+
"type": {
168+
"ignore_above": 1024,
169+
"type": "keyword"
170+
},
171+
"version": {
172+
"ignore_above": 1024,
173+
"type": "keyword"
174+
}
175+
}
176+
},
177+
"type": {
178+
"ignore_above": 1024,
179+
"type": "keyword"
180+
},
181+
"uptime": {
182+
"type": "long"
183+
}
184+
}
185+
}
186+
}
187+
}
188+
}
189+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"_meta": {
3+
"ecs_version": "8.0.0"
4+
},
5+
"template": {
6+
"mappings": {
7+
"properties": {
8+
"metricset": {
9+
"properties": {
10+
"interval": {
11+
"type": "long"
12+
}
13+
}
14+
}
15+
}
16+
}
17+
}
18+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"_meta": {
3+
"ecs_version": "8.0.0"
4+
},
5+
"template": {
6+
"mappings": {
7+
"properties": {
8+
"system": {
9+
"properties": {
10+
"cpu": {
11+
"properties": {
12+
"cores": {
13+
"type": "integer"
14+
},
15+
"system": {
16+
"properties": {
17+
"pct": {
18+
"type": "float"
19+
}
20+
}
21+
},
22+
"total": {
23+
"properties": {
24+
"norm": {
25+
"properties": {
26+
"pct": {
27+
"type": "float"
28+
}
29+
}
30+
}
31+
}
32+
},
33+
"user": {
34+
"properties": {
35+
"pct": {
36+
"type": "float"
37+
}
38+
}
39+
}
40+
}
41+
},
42+
"network": {
43+
"properties": {
44+
"in": {
45+
"properties": {
46+
"bytes": {
47+
"type": "long"
48+
}
49+
}
50+
},
51+
"name": {
52+
"ignore_above": 1024,
53+
"type": "keyword"
54+
},
55+
"out": {
56+
"properties": {
57+
"bytes": {
58+
"type": "long"
59+
}
60+
}
61+
}
62+
}
63+
}
64+
}
65+
}
66+
}
67+
}
68+
}
69+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"_meta": {
3+
"description": "Sample composable template that includes all ECS fields",
4+
"ecs_version": "8.0.0"
5+
},
6+
"composed_of": [
7+
"ecs_8.0.0_base",
8+
"ecs_8.0.0_event",
9+
"ecs_8.0.0_host",
10+
"ecs_8.0.0_metricset",
11+
"ecs_8.0.0_system"
12+
],
13+
"index_patterns": [
14+
"kbn-data-forge-fake_hosts"
15+
],
16+
"priority": 1,
17+
"template": {
18+
"mappings": {
19+
"_meta": {
20+
"version": "1.6.0"
21+
},
22+
"date_detection": false,
23+
"dynamic_templates": [
24+
{
25+
"strings_as_keyword": {
26+
"mapping": {
27+
"fields": {
28+
"text": {
29+
"norms": false,
30+
"type": "text"
31+
}
32+
},
33+
"ignore_above": 1024,
34+
"type": "keyword"
35+
},
36+
"match_mapping_type": "string"
37+
}
38+
}
39+
]
40+
},
41+
"settings": {
42+
"index": {
43+
"codec": "best_compression",
44+
"mapping": {
45+
"total_fields": {
46+
"limit": 2000
47+
}
48+
}
49+
}
50+
}
51+
}
52+
}

x-pack/packages/kbn-infra-forge/src/data_sources/fake_hosts/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import lodash from 'lodash';
99
import type { Moment } from 'moment';
1010

11-
export { template } from './template';
11+
export { indexTemplate } from './index_template_def';
1212

1313
const createGroupIndex = (index: number) => Math.floor(index / 1000) * 1000;
1414

0 commit comments

Comments
 (0)