Skip to content

Use policy template name as default dataset for input packages#3037

Merged
jsoriano merged 8 commits intoelastic:mainfrom
jsoriano:input-packages-ds-system-tests
Nov 18, 2025
Merged

Use policy template name as default dataset for input packages#3037
jsoriano merged 8 commits intoelastic:mainfrom
jsoriano:input-packages-ds-system-tests

Conversation

@jsoriano
Copy link
Member

@jsoriano jsoriano commented Oct 29, 2025

Fix #3036.

Default dataset in integration packages is formed as <package name>.<data stream name>, both in elastic-package and Fleet.

In the case of input packages, elastic-package was forming it as something like <package name>.<policy template name>, but Fleet uses only the policy template name.

Do the same as Fleet for input packages.

Default dataset in integration packages is formed as <package name>.<data stream name>,
both in elastic-package and Fleet.

In the case of input packages, elastic-package was forming it as something like
<package name>.<policy template name>, but Fleet uses only the policy template name.

Do the same as Fleet for input packages.
@jsoriano jsoriano requested a review from a team October 29, 2025 18:52
@jsoriano jsoriano self-assigned this Oct 29, 2025
@jsoriano
Copy link
Member Author

test integrations

@elastic-vault-github-plugin-prod

Created or updated PR in integrations repository to test this version. Check elastic/integrations#15808

@jsoriano
Copy link
Member Author

Failures in cel and websockets in elastic/integrations#15808 are probably related, I will take a look.

@jsoriano
Copy link
Member Author

Failures in cel and websockets in elastic/integrations#15808 are probably related, I will take a look.

These packages set a default value for the data_stream.dataset variable. This will need to be taken into account.

jamesagarside added a commit to elastic/integrations that referenced this pull request Nov 12, 2025
- Add use_logs_stream configuration option to enable sending data to the unified "logs" data stream
- Update tcp.yml.hbs and udp.yml.hbs templates to conditionally route to logs index
- Bump TCP version to 2.1.0 and UDP version to 2.3.0
- Follows the same pattern as filestream package

This feature allows users to send all ingested data to the "logs" data stream instead of custom datasets when the "Write to logs streams" option is enabled in output settings.

Note: System tests for logs-stream variants will fail due to a known elastic-package bug being fixed in elastic/elastic-package#3037. Policy tests pass, confirming the configuration is correct.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
jamesagarside added a commit to jamesagarside/integrations that referenced this pull request Nov 12, 2025
- Add use_logs_stream configuration option to enable sending data to the unified "logs" data stream
- Update tcp.yml.hbs and udp.yml.hbs templates to conditionally route to logs index
- Bump TCP version to 2.1.0 and UDP version to 2.3.0
- Follows the same pattern as filestream package

This feature allows users to send all ingested data to the "logs" data stream instead of custom datasets when the "Write to logs streams" option is enabled in output settings.

Note: System tests for logs-stream variants will fail due to a known elastic-package bug being fixed in elastic/elastic-package#3037. Policy tests pass, confirming the configuration is correct.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
jamesagarside added a commit to jamesagarside/integrations that referenced this pull request Nov 12, 2025
- Add use_logs_stream configuration option to enable sending data to the unified "logs" data stream
- Update tcp.yml.hbs and udp.yml.hbs templates to conditionally route to logs index
- Bump TCP version to 2.1.0 and UDP version to 2.3.0
- Follows the same pattern as filestream package

This feature allows users to send all ingested data to the "logs" data stream instead of custom datasets when the "Write to logs streams" option is enabled in output settings.

Note: System tests for logs-stream variants will fail due to a known elastic-package bug being fixed in elastic/elastic-package#3037. Policy tests pass, confirming the configuration is correct.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jsoriano
Copy link
Member Author

test integrations

@elastic-vault-github-plugin-prod

Created or updated PR in integrations repository to test this version. Check elastic/integrations#15808

@jsoriano jsoriano marked this pull request as ready for review November 13, 2025 23:31
@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 14, 2025

💔 Build Failed

Failed CI Steps

History

cc @jsoriano

if expectedDatasets == nil {
if len(expectedDatasets) == 0 {
// get dataset directly from package policy added when preparing the scenario
expectedDataset := scenario.kibanaDataStream.Inputs[0].Streams[0].DataStream.Dataset
Copy link
Contributor

Choose a reason for hiding this comment

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

could this piece of code be replaced so it uses getExpectedDatasetForTest ?? does it make sense to add some unit test for that function to check its behaving as expected?

Copy link
Member Author

Choose a reason for hiding this comment

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

could this piece of code be replaced so it uses getExpectedDatasetForTest ??

Good point, yes, we can reuse it, we need to keep the otel-specific code here because in some places we want it and in others we don't.

Changed in bc4bf90, also added another case for the integration tests.

does it make sense to add some unit test for that function to check its behaving as expected?

👍 added in c6d3eb2.

Copy link
Contributor

@mrodm mrodm left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +2031 to +2035
// This dataset is the one Fleet uses to identify the stream,
// it must be <package name>.<policy template name>. This is not
// the same as the dataset used for the index template, configured
// with vars below.
Dataset: fmt.Sprintf("%s.%s", pkg.Name, policyTemplate.Name),
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding this explanation!

@jsoriano jsoriano merged commit 4d0d14b into elastic:main Nov 18, 2025
3 checks passed
@jsoriano jsoriano deleted the input-packages-ds-system-tests branch November 18, 2025 12:16
taylor-swanson pushed a commit to elastic/integrations that referenced this pull request Dec 2, 2025
This feature allows users to send all ingested data to the "logs" data stream instead of custom datasets when the "Write to logs streams" option is enabled in output settings.

Note: System tests for logs-stream variants will fail due to a known elastic-package bug being fixed in elastic/elastic-package#3037. Policy tests pass, confirming the configuration is correct.

- Add use_logs_stream configuration option to enable sending data to the unified "logs" data stream
- Update tcp.yml.hbs and udp.yml.hbs templates to conditionally route to logs index
- Bump TCP version to 2.1.0 and UDP version to 2.3.0
- Follows the same pattern as filestream package
- Changed version constraint from "^8.13.0 || ^9.0.0" to "^9.2.0" for both TCP and UDP packages since Elastic Streams was introduced in 9.2.0.

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

System tests should use the policy template name as default dataset for input packages

4 participants