-
Notifications
You must be signed in to change notification settings - Fork 124
Support routing_rules.yml and ingest pipeline test for reroute processor #1372
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
Support routing_rules.yml and ingest pipeline test for reroute processor #1372
Conversation
Hey @kaiyan-sheng, This PR adds support to test the reroute processors defined on ingest pipelines, right? But the recommended way to add routing rules is to use the I think that appart of these changes, for pipeline tests, we would need to make It would be also great to add a test package here. |
Also, by reading the |
The routing rules in |
Yes, they are translated to reroute processors when installed through Fleet, but I think that currently |
@jsoriano Yep it only looks for the yml files under |
More than happy to help with adding support for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding tests! It looks like expectation files need to be regenerated.
...s/parallel/awsfirehose/data_stream/log/_dev/test/pipeline/test-cloudtrail.json-expected.json
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
💚 Build Succeeded
History
|
What does this PR do?
This PR does two things:
routing_rules.yml
file when running pipeline test using commandelastic-package test pipeline -d <datastream> --generate -v
.routing_rules.yml
now can be read and take into account when running the test pipeline command. The file is read as yml and convert into reroute processors. Then these reroute processors are attached under theprocessors
section from the ingest pipeline.For example:
routing_rules.yml
looks like the example above will be translated into:elasticsearch/ingest_pipeline
directly.data_stream.dataset
, it's read from the reroute processors for the new target dataset. Because reroute processor will change the value of this field.How to test this PR locally
I've been testing this PR locally with elastic/integrations#7146. After
make build
elastic package locally, I ranelastic-package test pipeline -d log --generate -v
and underintegrations/packages/awsfirehose/data_stream/log/_dev/test/pipeline/test-cloudtrail.json-expected.json
, you can see thedata_stream.dataset
value changed toaws.cloudtrail
anddata_stream.namespace
changed todefault
. These are the two fields I defined underreroute
processor:Same thing works for defining it under
routing_rules.yml