-
Notifications
You must be signed in to change notification settings - Fork 307
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
Is it possible to support indexing of dynamic variables using rollover? #858
Comments
If ES bulk can determine that the target index is not a rollover index and returns an error to logstash , then should it be able to create it automatically? |
This does not appear to work today. Without ILM, Logstash variable substitution works as expected:
But the equivalent for ILM does not work. Both
|
Until this is addressed, it will be helpful to set expectations in the documentation in these sections:
|
This is unfortunate; |
I managed to cobble something terrible together that appears to work (see here). It's not great, but it is functional. I still have some things to tinker with but at least this works for now. Sample run/config as an example here: |
I've made some additional changes to this to allow it to do the creation of the rollover index with the specified pattern, but without setting the settings, etc. When I tried this initially without the modifications the cluster came to a complete stop after a few hours, filled with Letting logstash just create the aliases seems to be a good compromise. We are able to have something external do the process of rollover. We don't have to worry about creating the index patterns or about ILM rollover related tasks clogging things up. |
We also would love to use ILM within logstash but were hit by this issue. We would like to use dynamic naming in the ilm_rollover_alias setting like we used to in the index setting. A short search learns that quite a few people run into this limitation with ilm in the elasticsearch output: |
Same here. We would love to leverage the ilm_* settings within logstash to help manage this but were stopped dead-in-the-water due to this limitation. |
Same issue here, +1 for adding this feature |
+1 here, being able to dynamically set |
I don't see how ilm without dynamic setting like index is even usable if you're not looking to hand curate all of your indices, or wanting to work outside of the cluster to provide the functionality |
I've opened an issue about this scenario when ILM initially was introduced. Having the ability to use variables inside these settings is essential for us to make dynamic rollover patterns work. This feature would be a huge benefit for our large elasticsearch infrastructure. EDIT: Here the request from 2018 about this feature: #805 (comment) |
+1, also looking to set ilm_rollover_alias dynamically |
+1 |
+1, I am also looking for this |
+1, same here. |
1 similar comment
+1, same here. |
+1 |
Trying to use CPM compounds the issue as CPM currently doesn't support wildcards in xpack.management.pipeline.id so we need to use pipelines with aggregated inputs but cannot dynamically assign ilm policies without being able to use substitutions like we can with index names. Once CPM can support wildcards for pipeline.id's then we could have a pipeline per output with a static ilm name. |
I wrote a Kubernetes controller to solve these current limitations and automates the rollover pattern. This will help if you want to forward Kubernetes Pod logs to Elasticsearch. If you are interested you can take a look here: https://gitlab.com/msvechla/es-rollover-controller |
+1 |
1 similar comment
+1 |
Any news on this? |
+1 |
3 similar comments
+1 |
+1 |
+1 |
This comment has been minimized.
This comment has been minimized.
Quick update: a meta issue has been created in elasticsearch to track the work of building the concept of alias templates, which facilitates the support of dynamic parameters in this plugin's ILM setup. For those interested in this feature you can track the progress here: elastic/elasticsearch#51995 |
This comment has been minimized.
This comment has been minimized.
+1 |
+1 input { } output { As the above example.. I need to insert the Topic Name in ilm_rollover_alias and I can have single configuration for multiple Kafka topics instead of creating a new pipeline for each kafka topic. |
+1 |
+1 |
+1 |
+1 |
+1 |
Another thumbs up over here: 👍 |
yes +1, we currently use a shell script to bulk create a ton of templates as a workaround lol |
+1, finally got all my indexes generating via labels per app how I wanted it to only realise I can't use the dynamically generated name/index with ILM :( |
With version 7.9's new data streams implementation, we should be able to leverage this new feature to achieve dynamic variable substitution for index names with ILM+rollover. I have submitted a doc issue with draft for proper documentation, pending review. This serves as the stop gap recipe for implementing data streams with Logstash until a new Elasticsearch Data Stream output plugin is available in the future. |
Unfortunately nothing has changed here. This was possible before, by setting up the rollover pattern via index template, ILM policy, rollover index and write alias manually and finally pointing logstash at the write alias with variable substitution. In your example everything is still setup manually. I thought this issue is about allowing variable substitution, when dynamically creating the required artifacts for rollover / ILM (e.g. ilm rollover alias, see #858 (comment))? Data streams definitely make the bootstrapping of rollver and ILM a lot easier, however I think the original issue is still not solved, right? |
My thoughts were the user wants to use %{VAR} in the ILM alias (which wouldnt work ) , which they can do now with data streams as a data stream can be created dynamically (via the index name provided in the index request and a matching mapping template). |
Awesome, thanks for clarifying, I totally missed this functionality. Indeed, we can then setup an index template including a data stream and ILM once, with a more generic index pattern such as That's a big improvement, thanks for the hint! |
Any updates on this?
This is what I'm expecting. I can use a dynamic index, by getting log_index from Filebeat. I want to use the same in ilm_rollover_alias. |
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Logstash does not yet support datastreams. So even if datastreams solves the issue, logstash can't use it. |
@Karrade7 we're using data streams with logstash |
Logstash has started supporting Data Streams since 7.13.0. ILM, when used without Data Streams will not be able to automatically create aliases, this is a known design limitation of the Elasticsearch feature so there is no "fix on the Logstash side".
Hopefully the Data Streams feature in ES + support for built in Datastreams in Logstash + direct writing to a data stream with create action solves all the needs y'all have. One last thing we'll likely end up adding is a separate setting to specify a |
Provided the above explanation, and there hasn't been any further discussion, I'm going to go ahead and close this issue. If anyone believe this issue still applies to you, please feel free to re-open or create a new issue. Thanks. |
output {
elasticsearch {
hosts => [ 'ccc.om:9200' ]
ilm_enabled => true
ilm_rollover_alias => "cbg_%{product}_%{log}_loghub"
}
}
Now it is time to determine if rolloverneeds to create rollover when it starts.
@robbavey
The text was updated successfully, but these errors were encountered: