|
|
@@ -466,13 +466,13 @@ dynamic templates with nesting:
|
|
|
refresh: true
|
|
|
body:
|
|
|
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
- - '{ "@timestamp": "2023-09-01T13:03:08.138Z","data": "10", "resource.attributes.dim1": "A", "resource.attributes.another.dim1": "1", "attributes.dim2": "C", "attributes.another.dim2": "10.5" }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:03:08.138Z","data": "10", "resource.attributes.dim1": "A", "resource.attributes.another.dim1": "1", "attributes.dim2": "C", "attributes.another.dim2": "10.5", "attributes.a.much.deeper.nested.dim": "AC" }'
|
|
|
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
- - '{ "@timestamp": "2023-09-01T13:03:09.138Z","data": "20", "resource.attributes.dim1": "A", "resource.attributes.another.dim1": "1", "attributes.dim2": "C", "attributes.another.dim2": "10.5" }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:03:09.138Z","data": "20", "resource.attributes.dim1": "A", "resource.attributes.another.dim1": "1", "attributes.dim2": "C", "attributes.another.dim2": "10.5", "attributes.a.much.deeper.nested.dim": "AC" }'
|
|
|
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
- - '{ "@timestamp": "2023-09-01T13:03:10.138Z","data": "30", "resource.attributes.dim1": "B", "resource.attributes.another.dim1": "2", "attributes.dim2": "D", "attributes.another.dim2": "20.5" }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:03:10.138Z","data": "30", "resource.attributes.dim1": "B", "resource.attributes.another.dim1": "2", "attributes.dim2": "D", "attributes.another.dim2": "20.5", "attributes.a.much.deeper.nested.dim": "BD" }'
|
|
|
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
- - '{ "@timestamp": "2023-09-01T13:03:10.238Z","data": "40", "resource.attributes.dim1": "B", "resource.attributes.another.dim1": "2", "attributes.dim2": "D", "attributes.another.dim2": "20.5" }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:03:10.238Z","data": "40", "resource.attributes.dim1": "B", "resource.attributes.another.dim1": "2", "attributes.dim2": "D", "attributes.another.dim2": "20.5", "attributes.a.much.deeper.nested.dim": "BD" }'
|
|
|
|
|
|
- do:
|
|
|
search:
|
|
|
@@ -498,7 +498,7 @@ dynamic templates with nesting:
|
|
|
field: _tsid
|
|
|
|
|
|
- length: { aggregations.filterA.tsids.buckets: 1 }
|
|
|
- - match: { aggregations.filterA.tsids.buckets.0.key: "MK0AtuFZowY4QPzoYEAZNK6pWmkqIGKYiosO9O4X2dfFL8p_4TfsFAUUYYv9EqSmEQ" }
|
|
|
+ - match: { aggregations.filterA.tsids.buckets.0.key: "NNnsRFDTqKogyRBhOBQclM4BkssYqVppKiBimIqLDvTuF9nXxZWMD04YHQKL09tJYL5G4yo" }
|
|
|
- match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }
|
|
|
|
|
|
- do:
|
|
|
@@ -517,7 +517,7 @@ dynamic templates with nesting:
|
|
|
field: _tsid
|
|
|
|
|
|
- length: { aggregations.filterA.tsids.buckets: 1 }
|
|
|
- - match: { aggregations.filterA.tsids.buckets.0.key: "MK0AtuFZowY4QPzoYEAZNK6pWmkqIGKYiosO9O4X2dfFL8p_4TfsFAUUYYv9EqSmEQ" }
|
|
|
+ - match: { aggregations.filterA.tsids.buckets.0.key: "NNnsRFDTqKogyRBhOBQclM4BkssYqVppKiBimIqLDvTuF9nXxZWMD04YHQKL09tJYL5G4yo" }
|
|
|
- match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }
|
|
|
|
|
|
- do:
|
|
|
@@ -536,7 +536,7 @@ dynamic templates with nesting:
|
|
|
field: _tsid
|
|
|
|
|
|
- length: { aggregations.filterA.tsids.buckets: 1 }
|
|
|
- - match: { aggregations.filterA.tsids.buckets.0.key: "MK0AtuFZowY4QPzoYEAZNK6pWmkqIGKYiosO9O4X2dfFL8p_4TfsFAUUYYv9EqSmEQ" }
|
|
|
+ - match: { aggregations.filterA.tsids.buckets.0.key: "NNnsRFDTqKogyRBhOBQclM4BkssYqVppKiBimIqLDvTuF9nXxZWMD04YHQKL09tJYL5G4yo" }
|
|
|
- match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }
|
|
|
|
|
|
- do:
|
|
|
@@ -555,7 +555,220 @@ dynamic templates with nesting:
|
|
|
field: _tsid
|
|
|
|
|
|
- length: { aggregations.filterA.tsids.buckets: 1 }
|
|
|
- - match: { aggregations.filterA.tsids.buckets.0.key: "MK0AtuFZowY4QPzoYEAZNK6pWmkqIGKYiosO9O4X2dfFL8p_4TfsFAUUYYv9EqSmEQ" }
|
|
|
+ - match: { aggregations.filterA.tsids.buckets.0.key: "NNnsRFDTqKogyRBhOBQclM4BkssYqVppKiBimIqLDvTuF9nXxZWMD04YHQKL09tJYL5G4yo" }
|
|
|
+ - match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: k9s
|
|
|
+ body:
|
|
|
+ size: 0
|
|
|
+ aggs:
|
|
|
+ filterA:
|
|
|
+ filter:
|
|
|
+ term:
|
|
|
+ a.much.deeper.nested.dim: AC
|
|
|
+ aggs:
|
|
|
+ tsids:
|
|
|
+ terms:
|
|
|
+ field: _tsid
|
|
|
+
|
|
|
+ - length: { aggregations.filterA.tsids.buckets: 1 }
|
|
|
+ - match: { aggregations.filterA.tsids.buckets.0.key: "NNnsRFDTqKogyRBhOBQclM4BkssYqVppKiBimIqLDvTuF9nXxZWMD04YHQKL09tJYL5G4yo" }
|
|
|
+ - match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }
|
|
|
+
|
|
|
+---
|
|
|
+dynamic templates with incremental indexing:
|
|
|
+ - skip:
|
|
|
+ version: " - 8.12.99"
|
|
|
+ reason: "Support for dynamic fields was added in 8.13"
|
|
|
+ - do:
|
|
|
+ allowed_warnings:
|
|
|
+ - "index template [my-dynamic-template] has index patterns [k9s*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-dynamic-template] will take precedence during new index creation"
|
|
|
+ indices.put_index_template:
|
|
|
+ name: my-dynamic-template
|
|
|
+ body:
|
|
|
+ index_patterns: [k9s*]
|
|
|
+ data_stream: {}
|
|
|
+ template:
|
|
|
+ settings:
|
|
|
+ index:
|
|
|
+ number_of_shards: 1
|
|
|
+ mode: time_series
|
|
|
+ time_series:
|
|
|
+ start_time: 2023-08-31T13:03:08.138Z
|
|
|
+
|
|
|
+ mappings:
|
|
|
+ properties:
|
|
|
+ attributes:
|
|
|
+ type: passthrough
|
|
|
+ dynamic: true
|
|
|
+ time_series_dimension: true
|
|
|
+ resource:
|
|
|
+ type: object
|
|
|
+ properties:
|
|
|
+ attributes:
|
|
|
+ type: passthrough
|
|
|
+ dynamic: true
|
|
|
+ time_series_dimension: true
|
|
|
+ dynamic_templates:
|
|
|
+ - counter_metric:
|
|
|
+ mapping:
|
|
|
+ type: integer
|
|
|
+ time_series_metric: counter
|
|
|
+
|
|
|
+ - do:
|
|
|
+ bulk:
|
|
|
+ index: k9s
|
|
|
+ refresh: true
|
|
|
+ body:
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:03:08.138Z","data": "10", "resource.attributes.dim1": "A", "attributes.dim2": "C" }'
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:03:09.138Z","data": "20", "resource.attributes.dim1": "A", "attributes.dim2": "C" }'
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:03:10.138Z","data": "30", "resource.attributes.dim1": "B", "attributes.dim2": "D" }'
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:03:10.238Z","data": "40", "resource.attributes.dim1": "B", "attributes.dim2": "D" }'
|
|
|
+
|
|
|
+ - do:
|
|
|
+ bulk:
|
|
|
+ index: k9s
|
|
|
+ refresh: true
|
|
|
+ body:
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:04:08.138Z","data": "110", "resource.attributes.another.dim1": "1", "attributes.another.dim2": "10.5" }'
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:04:09.138Z","data": "120", "resource.attributes.another.dim1": "1", "attributes.another.dim2": "10.5" }'
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:04:10.138Z","data": "130", "resource.attributes.another.dim1": "2", "attributes.another.dim2": "20.5" }'
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:04:10.238Z","data": "140", "resource.attributes.another.dim1": "2", "attributes.another.dim2": "20.5" }'
|
|
|
+
|
|
|
+ - do:
|
|
|
+ bulk:
|
|
|
+ index: k9s
|
|
|
+ refresh: true
|
|
|
+ body:
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:05:08.138Z","data": "210", "resource.attributes.another.deeper.dim1": "1", "attributes.another.deeper.dim2": "10.5" }'
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:05:09.138Z","data": "220", "resource.attributes.another.deeper.dim1": "1", "attributes.another.deeper.dim2": "10.5" }'
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:05:10.138Z","data": "230", "resource.attributes.another.deeper.dim1": "2", "attributes.another.deeper.dim2": "20.5" }'
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:05:10.238Z","data": "240", "resource.attributes.another.deeper.dim1": "2", "attributes.another.deeper.dim2": "20.5" }'
|
|
|
+
|
|
|
+ - do:
|
|
|
+ bulk:
|
|
|
+ index: k9s
|
|
|
+ refresh: true
|
|
|
+ body:
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:06:08.138Z","data": "310", "attributes.a.much.deeper.nested.dim": "AC" }'
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:06:09.138Z","data": "320", "attributes.a.much.deeper.nested.dim": "AC" }'
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:06:10.138Z","data": "330", "attributes.a.much.deeper.nested.dim": "BD" }'
|
|
|
+ - '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
|
|
|
+ - '{ "@timestamp": "2023-09-01T13:06:10.238Z","data": "340", "attributes.a.much.deeper.nested.dim": "BD" }'
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: k9s
|
|
|
+ body:
|
|
|
+ size: 0
|
|
|
+
|
|
|
+ - match: { hits.total.value: 16 }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: k9s
|
|
|
+ body:
|
|
|
+ size: 0
|
|
|
+ aggs:
|
|
|
+ filterA:
|
|
|
+ filter:
|
|
|
+ term:
|
|
|
+ dim1: A
|
|
|
+ aggs:
|
|
|
+ tsids:
|
|
|
+ terms:
|
|
|
+ field: _tsid
|
|
|
+
|
|
|
+ - length: { aggregations.filterA.tsids.buckets: 1 }
|
|
|
+ - match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: k9s
|
|
|
+ body:
|
|
|
+ size: 0
|
|
|
+ aggs:
|
|
|
+ filterA:
|
|
|
+ filter:
|
|
|
+ term:
|
|
|
+ dim2: C
|
|
|
+ aggs:
|
|
|
+ tsids:
|
|
|
+ terms:
|
|
|
+ field: _tsid
|
|
|
+
|
|
|
+ - length: { aggregations.filterA.tsids.buckets: 1 }
|
|
|
+ - match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: k9s
|
|
|
+ body:
|
|
|
+ size: 0
|
|
|
+ aggs:
|
|
|
+ filterA:
|
|
|
+ filter:
|
|
|
+ term:
|
|
|
+ another.deeper.dim1: 1
|
|
|
+ aggs:
|
|
|
+ tsids:
|
|
|
+ terms:
|
|
|
+ field: _tsid
|
|
|
+
|
|
|
+ - length: { aggregations.filterA.tsids.buckets: 1 }
|
|
|
+ - match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: k9s
|
|
|
+ body:
|
|
|
+ size: 0
|
|
|
+ aggs:
|
|
|
+ filterA:
|
|
|
+ filter:
|
|
|
+ term:
|
|
|
+ another.deeper.dim2: 10.5
|
|
|
+ aggs:
|
|
|
+ tsids:
|
|
|
+ terms:
|
|
|
+ field: _tsid
|
|
|
+
|
|
|
+ - length: { aggregations.filterA.tsids.buckets: 1 }
|
|
|
+ - match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }
|
|
|
+
|
|
|
+ - do:
|
|
|
+ search:
|
|
|
+ index: k9s
|
|
|
+ body:
|
|
|
+ size: 0
|
|
|
+ aggs:
|
|
|
+ filterA:
|
|
|
+ filter:
|
|
|
+ term:
|
|
|
+ a.much.deeper.nested.dim: AC
|
|
|
+ aggs:
|
|
|
+ tsids:
|
|
|
+ terms:
|
|
|
+ field: _tsid
|
|
|
+
|
|
|
+ - length: { aggregations.filterA.tsids.buckets: 1 }
|
|
|
- match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }
|
|
|
|
|
|
---
|