Skip to content

Commit e7d3037

Browse files
committed
feat: change to flat fields for rollup index
1 parent d22e214 commit e7d3037

File tree

2 files changed

+22
-49
lines changed

2 files changed

+22
-49
lines changed

workflow-cli/configuration-opensearch/index_template/accessrollup.json

Lines changed: 13 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,57 +12,25 @@
1212
},
1313
"mappings": {
1414
"properties": {
15-
"@timestamp": {
16-
"properties": {
17-
"date_histogram": {
18-
"type": "date"
19-
}
20-
}
15+
"timestamp_date_histogram": {
16+
"type": "date"
2117
},
22-
"url": {
23-
"properties": {
24-
"full": {
25-
"properties": {
26-
"keyword": {
27-
"properties": {
28-
"terms": {
29-
"type": "keyword"
30-
}
31-
}
32-
}
33-
}
34-
},
35-
"domain": {
36-
"properties": {
37-
"terms": {
38-
"type": "keyword"
39-
}
40-
}
41-
}
42-
}
18+
"url_full_keyword": {
19+
"type": "keyword"
4320
},
44-
"event": {
45-
"properties": {
46-
"outcome": {
47-
"properties": {
48-
"value_count": {
49-
"type": "long"
50-
}
51-
}
52-
},
53-
"duration": {
54-
"properties": {
55-
"avg": {
56-
"type": "double"
57-
}
58-
}
59-
}
60-
}
21+
"url_domain": {
22+
"type": "keyword"
23+
},
24+
"event_outcome_count": {
25+
"type": "long"
26+
},
27+
"event_duration_avg": {
28+
"type": "double"
6129
}
6230
}
6331
}
6432
},
65-
"version": 1,
33+
"version": 2,
6634
"priority": 300,
6735
"_meta": {
6836
"description": "NRM Access Url Rollup indices"

workflow-cli/configuration-opensearch/state_management_policy/nrm-type-access-external-policy.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,21 @@
5555
{
5656
"date_histogram": {
5757
"source_field": "@timestamp",
58+
"target_field": "timestamp_date_histogram",
5859
"fixed_interval": "60m",
5960
"timezone": "America/Vancouver"
6061
}
6162
},
6263
{
6364
"terms": {
64-
"source_field": "url.full.keyword"
65+
"source_field": "url.full.keyword",
66+
"target_field": "url_full_keyword"
6567
}
6668
},
6769
{
6870
"terms": {
69-
"source_field": "url.domain"
71+
"source_field": "url.domain",
72+
"target_field": "url_domain"
7073
}
7174
}
7275
],
@@ -77,15 +80,17 @@
7780
{
7881
"value_count": {}
7982
}
80-
]
83+
],
84+
"target_field": "event_outcome_count"
8185
},
8286
{
8387
"source_field": "event.duration",
8488
"metrics": [
8589
{
8690
"avg": {}
8791
}
88-
]
92+
],
93+
"target_field": "event_duration_avg"
8994
}
9095
]
9196
}

0 commit comments

Comments
 (0)