-
Notifications
You must be signed in to change notification settings - Fork 4.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
Filebeat: variables not expanded in rollover_alias #12233
Comments
Agree, that the |
If I do that I get the following error when starting the filebeat: Exiting: missing field accessing 'setup.ilm.rollover_alias' (source:'filebeat.yml') |
I can confirm there is a bug. Beats exit with an error on startup or when trying to run the As a workaround, @fpompermaier could you specify the version in the configuration until this is fixed? |
Fortunately commenting out setup.ilm.rollover_alias just works for me (I was going to use filebeat-{agent.version} anyway) so there's no problem right now in my setup. |
Update: the configuration would actually be
I would assume that independent of the config for |
@ph when working on this, you could modify the existing system test to pass in an alias without the version and check that an alias with the version is created. |
There are actually two distinct problem here, the rolloverAlias doesn't support the fieldref syntax, but to be constant with the documentation, I've decided to automatically appends the version, I did not make the rolloverAlias accepts a fieldref. |
I've been changing the index names depending on the log source for a long time, it became a natural feature to have filebeat handle multiple log sources to different indices. Beat was never used to create the templates, rather, we have a separate CI process to maintain pipelines and templates ( and now ILM ). With ILM enabled in beat there's no more way to do it and you have to spawn 1 filebeat per indices you need to populate. Not ideal at all. This
Is not working anymore ( using index_name worked before ). Did I miss something ? |
I've ended up spawning 1 filebeat per log type for now ... |
It is indeed a problem in real-world deployments if both
The following configuration results in the index name below:
Resulting index name: It seems there is currently no way to fix this (Beats 7.2.0). What we would like to have is the following:
|
Previously you were not able to defined fields in the roll over alias, this commit allow to use some of the global values. We also update the docs to remove the prefix part. Fixes elastic#12233
I've just tested the 7.5 version and now I can specify the variables in the pattern and in the alias. Is also the example setup.ilm.pattern right ( |
The ilm.pattern is correct. The date pattern is interpreted by Elasticsearch, not Beats. The docs for setup.ilm.rollover_alias is indeed missing the brackets. |
So after this change, can I use kubernetes variables? Like in this example:
|
No. ILM and templates are global settings. Beats do not manage templates + policies for multiple indices and have no access to fields in events. In fact templates and ILM policies are setup before the first event is available. This issue is about fixing the documentation, not changing behavior. |
@urso , this sucks because it does work with the old-school daily indices:
So, in this case I can either use an index pattern per kubernetes namespace, or I can use ILM. I can't use both. :( |
From documentation rollover_alias is by default filebeat-{agent.version} but if I set
setup.ilm.enabled: true
setup.ilm.rollover_alias: "filebeat-{agent.version}"
setup.ilm.pattern: "{now/d}-000001"
the index name is not the expected one (i.e. filebeat-7.1.0-2019.05.21-000001) but the index is created with name filebeat-{agent.version}.
Is it a problem of the documentation or is it a bug?
The text was updated successfully, but these errors were encountered: