Skip to content

Honor data_stream.dataset in input packages #1851

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

Merged
merged 1 commit into from
May 22, 2024

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented May 22, 2024

Input packages need to set data_stream.dataset in the agent configuration to actually send data to the configured dataset.

The configured dataset is set by the Fleet UI through a data_stream.dataset variable for input packages.

Following this, assume that system test configurations can include a data_stream.dataset variable, and use it in the places where a dataset is expected:

  • In the data stream name.
  • In the package component template.
  • In the package policy.
  • In the list of expected datasets.

Fixes #1806

@jsoriano jsoriano requested a review from a team May 22, 2024 12:06
@jsoriano jsoriano self-assigned this May 22, 2024
Comment on lines +2 to +3
data_stream:
dataset: {{data_stream.dataset}}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be required in input packages to actually leverage this option. I think we should handle this in a different way. Ideally Fleet should add this if this is required in all input packages. cc @kpollich @mrodm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think you are right. Fleet is enforcing this as a requirement, so Fleet should add this to the input package if it isn't explicitly set as a "default". Dynamically altering the handlebars template before rendering it isn't something we've done before in Fleet, but I don't think it will be more than some string manipulation. There's potential for complexity, though, to be sure. I created elastic/kibana#184008 to capture this on the Fleet side.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

I think this config could be appended if not already set.

@elasticmachine
Copy link
Collaborator

elasticmachine commented May 22, 2024

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @jsoriano

@jsoriano jsoriano merged commit 9680eb7 into elastic:main May 22, 2024
3 checks passed
@jsoriano jsoriano deleted the dataset-test-config-input-packages branch May 22, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data stream datasets are not picked up dynamically for Input type packages
4 participants