Add custom metadata support to data steams.#63991
Merged
martijnvg merged 6 commits intoelastic:masterfrom Oct 26, 2020
Merged
Conversation
Composable index template may hold custom metadata. This change adds behaviour that
when a data stream gets created the custom metadata of the matching composable index
template is copied to new data stream. The get data stream api can then be used to
view the custom metadata.
Example:
```
PUT /_index_template/my-logs-template
{
"index_patterns": [ "logs-*" ],
"data_stream": { },
"template": {
"settings": {
"index.number_of_replicas": 0
}
},
"_meta": {
"managed": true
}
}
PUT /_data_stream/logs-myapp
GET /_data_stream
```
The get data stream api then yields the following response:
```
{
"data_streams": [
{
"name": "logs-myapp",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-logs-myapp-000001",
"index_uuid": "3UaBxM3mQXuHR6qx0IDVCw"
}
],
"generation": 1,
"_meta": {
"managed": true
},
"status": "GREEN",
"template": "my-logs-template"
}
]
}
```
Closes elastic#59195
Collaborator
|
Pinging @elastic/es-core-features (:Core/Features/Data streams) |
yuliacech
approved these changes
Oct 22, 2020
Contributor
yuliacech
left a comment
There was a problem hiding this comment.
Hi @martijnvg , thanks a lot for adding this! Tested locally and got the data stream's meta data in response.
martijnvg
added a commit
to martijnvg/elasticsearch
that referenced
this pull request
Oct 26, 2020
Composable index template may hold custom metadata. This change adds behaviour that
when a data stream gets created the custom metadata of the matching composable index
template is copied to new data stream. The get data stream api can then be used to
view the custom metadata.
Example:
```
PUT /_index_template/my-logs-template
{
"index_patterns": [ "logs-*" ],
"data_stream": { },
"template": {
"settings": {
"index.number_of_replicas": 0
}
},
"_meta": {
"managed": true
}
}
PUT /_data_stream/logs-myapp
GET /_data_stream
```
The get data stream api then yields the following response:
```
{
"data_streams": [
{
"name": "logs-myapp",
"timestamp_field": {
"name": "@timestamp"
},
"indices": [
{
"index_name": ".ds-logs-myapp-000001",
"index_uuid": "3UaBxM3mQXuHR6qx0IDVCw"
}
],
"generation": 1,
"_meta": {
"managed": true
},
"status": "GREEN",
"template": "my-logs-template"
}
]
}
```
Closes elastic#59195
martijnvg
added a commit
to martijnvg/elasticsearch
that referenced
this pull request
Oct 26, 2020
after backporting elastic#63991 to 7. branch.
martijnvg
added a commit
that referenced
this pull request
Oct 26, 2020
after backporting #63991 to 7. branch.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Composable index template may hold custom metadata. This change adds behaviour that
when a data stream gets created the custom metadata of the matching composable index
template is copied to new data stream. The get data stream api can then be used to
view the custom metadata.
Example:
The get data stream api then yields the following response:
Closes #59195