forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
198 additions
and
599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,3 +177,138 @@ reject timestamp meta field with wrong type: | |
mappings: | ||
_data_stream_timestamp: | ||
enabled: false | ||
|
||
--- | ||
enable timestamp meta field: | ||
- skip: | ||
version: " - 8.0.99" | ||
reason: introduced in 8.0.0 to be backported to 7.16.0 | ||
|
||
- do: | ||
indices.create: | ||
index: test | ||
body: | ||
settings: | ||
index: | ||
mode: time_series | ||
routing_path: [metricset] | ||
number_of_replicas: 0 | ||
number_of_shards: 2 | ||
mappings: | ||
_data_stream_timestamp: | ||
enabled: true | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test | ||
- match: { "[email protected]": date } | ||
- match: { 'test.mappings._data_stream_timestamp.enabled': true } | ||
|
||
--- | ||
reject bad timestamp meta field: | ||
- skip: | ||
version: " - 8.0.99" | ||
reason: introduced in 8.0.0 to be backported to 7.16.0 | ||
|
||
- do: | ||
catch: /\[_data_stream_timestamp\] config must be an object/ | ||
indices.create: | ||
index: test | ||
body: | ||
settings: | ||
index: | ||
mode: time_series | ||
routing_path: [metricset] | ||
number_of_replicas: 0 | ||
number_of_shards: 2 | ||
mappings: | ||
_data_stream_timestamp: enabled | ||
|
||
--- | ||
write without timestamp: | ||
- skip: | ||
version: " - 7.99.99" | ||
reason: introduced in 8.0.0 to be backported to 7.16.0 | ||
|
||
- do: | ||
indices.create: | ||
index: test | ||
body: | ||
settings: | ||
index: | ||
mode: time_series | ||
routing_path: [metricset] | ||
number_of_replicas: 0 | ||
number_of_shards: 2 | ||
mappings: | ||
properties: | ||
"@timestamp": | ||
type: date | ||
metricset: | ||
type: keyword | ||
time_series_dimension: true | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test | ||
- match: { "[email protected]": date } | ||
- match: { 'test.mappings._data_stream_timestamp.enabled': true } | ||
|
||
- do: | ||
catch: /data stream timestamp field \[@timestamp\] is missing/ | ||
index: | ||
index: test | ||
body: | ||
"metricset": "pod" | ||
|
||
--- | ||
add timestamp meta: | ||
- skip: | ||
version: " - 7.99.99" | ||
reason: introduced in 8.0.0 to be backported to 7.16.0 | ||
|
||
- do: | ||
indices.create: | ||
index: test | ||
body: | ||
settings: | ||
index: | ||
mode: time_series | ||
routing_path: [metricset] | ||
number_of_replicas: 0 | ||
number_of_shards: 2 | ||
mappings: | ||
properties: | ||
"@timestamp": | ||
type: date | ||
meta: | ||
field_meta: time_series | ||
metricset: | ||
type: keyword | ||
time_series_dimension: true | ||
|
||
- do: | ||
index: | ||
refresh: true | ||
index: test | ||
body: { | ||
"@timestamp": 1632625793000, | ||
"metricset": "pod", | ||
"new_field" : "value" | ||
} | ||
|
||
- do: | ||
search: | ||
index: test | ||
body: | ||
docvalue_fields: [ '@timestamp', 'new_field.keyword' ] | ||
- match: { hits.total.value: 1 } | ||
- match: { hits.hits.0.fields.@timestamp: [ "2021-09-26T03:09:53.000Z" ] } | ||
- match: { hits.hits.0.fields.new_field\.keyword: [ "value" ] } | ||
|
||
- do: | ||
indices.get_mapping: | ||
index: test | ||
- match: { "[email protected]": date } | ||
- match: { "[email protected]_meta": time_series } | ||
- match: { 'test.mappings._data_stream_timestamp.enabled': true } |
Oops, something went wrong.