Skip to content
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

Improve DSL reference documentation to work by default #36733

Closed
cmacknz opened this issue Oct 4, 2023 · 2 comments · Fixed by #36750
Closed

Improve DSL reference documentation to work by default #36733

cmacknz opened this issue Oct 4, 2023 · 2 comments · Fixed by #36750
Assignees
Labels
Team:Elastic-Agent Label for the Agent team

Comments

@cmacknz
Copy link
Member

cmacknz commented Oct 4, 2023

This is a follow up from #36649

The default DSL pattern is currently defined as follows (using Filebeat as an example):

# Set the lifecycle policy name or pattern. For DSL, this name must match the data stream that the lifecycle is for.
# The default data stream pattern is filebeat-%{[agent.version]}"
#setup.dsl.data_stream_pattern: "filebeat-%{[agent.version]}"

This is correct in that the index pattern to match the version exactly should be filebeat-8.11.0, but the current example of setup.dsl.data_stream_pattern: "filebeat-%{[agent.version]}" does not work by default because the placeholder %{[agent.version]} wont' match anything.

We should ideally template in the actual stack version, which for docs purposes is defined in

:stack-version: 8.11.0
or
const defaultBeatVersion = "8.11.0"
in Go.

If that cannot be done, we should default to setup.dsl.data_stream_pattern: "filebeat-*" which is too broad but will at least work by default for a user trying Beats for the first time.

As an additional documentation nit, the end of the DSL section in the reference configuration needs a newline at the end to be consistent with the other sections:

#setup.dsl.overwrite: false
# =================================== Kibana ===================================
# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.

@cmacknz cmacknz added the Team:Elastic-Agent Label for the Agent team label Oct 4, 2023
@cmacknz cmacknz mentioned this issue Oct 4, 2023
6 tasks
@fearful-symmetry
Copy link
Contributor

So, technically the filebeat-%{[agent.version]} string is the default, as that's what the config will fall back on if you don't configure anything, and the built-in fmtstr library in libbeat will just resolve that to filebeat-8.11. My instinct says that the commented-out config should be the same as the actual default, and if anything we should either explain how the template works, or just change the documentation. Of course, setting the documentation to filebeat-8.11 would technically produce the same config as filebeat-%{[agent.version]}.

@cmacknz
Copy link
Member Author

cmacknz commented Oct 4, 2023

When I wrote this I did not even know that filebeat-%{[agent.version]} would be resolved by the Beat, I forgot this was the fmtstr syntax.

If it works as expected I'm fine keeping it if we explain this in the configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants