-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Make timestamp field mapping part of data stream definition #58583
Copy link
Copy link
Closed
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types:StorageEngine/Data streamsData streams and their lifecyclesData streams and their lifecyclesTeam:Data Management (obsolete)DO NOT USE. This team no longer exists.DO NOT USE. This team no longer exists.Team:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Description
Currently when creating a composable index template with a data stream definition, the timestamp field mapping must be defined too:
PUT /_index_template/logs_data_stream
{
"index_patterns": [ "logs*" ],
"data_stream": {
"timestamp_field": "@timestamp"
},
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
}
}
The template is much cleaner to read if the mapping itself for timestamp field mapping
is inlined with the data stream definition:
PUT /_index_template/logs_data_stream
{
"index_patterns": [ "logs*" ],
"data_stream": {
"timestamp_field": "@timestamp",
"timestamp_mapping": {
"type": "date"
}
}
}
Also since most of time, just "type": "date" will be provided, it makes sense to make this the default:
PUT /_index_template/logs_data_stream
{
"index_patterns": [ "logs*" ],
"data_stream": {
"timestamp_field": "@timestamp"
}
}
In the last two example the backing indices created will have the following mapping:
{
"_doc": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
}
The simulate index template api should also include the inserted / generated timestamp field mapping
in the response.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types:StorageEngine/Data streamsData streams and their lifecyclesData streams and their lifecyclesTeam:Data Management (obsolete)DO NOT USE. This team no longer exists.DO NOT USE. This team no longer exists.Team:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Type
Fields
Give feedbackNo fields configured for issues without a type.