-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]The new index after rollover is not managed by ism policy #3295
Comments
@lliu0947 did you solve your problem? how? |
yeah,i have solved it |
@lliu0947 how did you solve it? |
What was the solution here? Has anyone found a fix for this? |
Sorry for necroposting but I was struggling with this and just want to leave some info if/when someone else also stumbles upon this via google. The way I understand it, you need to create a policy that references the name of your datastream(s). So if the datastream is Now in the index template that is used by your datastream I also added the backing index regex (in the Advanced settings) like so Also the docs mention that
meaning you will need to manually rollever the indexes the first time to apply the policy on future indexes. To do this select the datastreams then Actions → Roll over. After that, the policy should be autoapplied on future indexes. |
@FriendlyTroll thank you! If you think the docs can be improved please do contribute For anyone reading this, we'd also love some help on opensearch-project/opensearch-api-specification#224 (we plan to generate docs from there). |
Describe the bug
I create a data stream and add ism policy to the data stream, but after index rollover, the new index is not managed by ism policy。
Steps to reproduce the behavior:
create ism policy
PUT _plugins/_ism/policies/test-ism-api
{
"policy": {
"description": "an example of the ism policy",
"default_state": "hot",
"states": [
{
"name": "hot",
"actions": [
{
"rollover": {
"min_doc_count": 5
}
}
],
"transitions": [
{
"state_name": "warm"
}
]
},
{
"name": "warm",
"actions": [{
"replica_count" : {
"number_of_replicas" : 1
}
}
],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "5m"
}
}
]
},
{
"name": "delete",
"actions": [
{
"delete": {}
}
],
"transitions": []
}
]
}
}
create index template
PUT _index_template/logs-template-nginx
{
"index_patterns": "logs-nginx",
"data_stream": {
"timestamp_field": {
"name": "request_time"
}
},
"template": {
"aliases": {
"my_logs": {}
},
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}
create data stream
PUT _data_stream/logs-nginx
get data stream information
{
"data_streams" : [
{
"name" : "logs-nginx",
"timestamp_field" : {
"name" : "request_time"
},
"indices" : [
{
"index_name" : ".ds-logs-nginx-000001",
"index_uuid" : "f7gTvToLTkqKWN1L1Bc9ug"
}
],
"generation" : 1,
"status" : "GREEN",
"template" : "logs-template-nginx"
}
]
}
manage data streams in OpenSearch Dashboards
open OpenSearch Dashboards, choose Index Management, select Indices or Policy managed indices. Follow the steps in the image below。
After index rollover, the new index is not managed by ism policy
in kibana, only one or more indexes in the data stream can be selected to associate the ism policy。Instead of associating the entire data stream with the ism policy, when rollover, you need to manually add the ism policy to the new index
Expected behavior
after index rollover,the new index is managed by ism policy
The text was updated successfully, but these errors were encountered: