[FR] Add Ability to Filter Rule Exports from Kibana#4783
Merged
eric-forte-elastic merged 3 commits intomainfrom Jun 9, 2025
Merged
[FR] Add Ability to Filter Rule Exports from Kibana#4783eric-forte-elastic merged 3 commits intomainfrom
eric-forte-elastic merged 3 commits intomainfrom
Conversation
Contributor
Enhancement - GuidelinesThese guidelines serve as a reminder set of considerations when addressing adding a feature to the code. Documentation and Context
Code Standards and Practices
Testing
Additional Checks
|
terrancedejesus
approved these changes
Jun 9, 2025
Mikaayenson
reviewed
Jun 9, 2025
Mikaayenson
reviewed
Jun 9, 2025
Mikaayenson
approved these changes
Jun 9, 2025
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Issue link(s):
Resolves #4768
Summary - What I changed
I added the ability to filter the output of the export rules kibana API call. This was accomplished using the bulk actions API Endpoint's query parameter. A small update was required to the Kibana library to enable using this feature.
New parameters to export rules:
--custom-rules-only/-croand--export-query/-eqHow To Test
To test this use the following command with a test stack to try and export only custom rules
python -m detection_rules kibana export-rules -d dac_test/rules -sv -ac -e -croExample Output
Additionally, try searching for a specific tag or other filter of your custom rules
python -m detection_rules kibana export-rules -d dac_test/rules -sv -ac -e -cro -eq "alert.attributes.tags: \"test\""Example Output
Additional Testing
Details
Checklist
bug,enhancement,schema,maintenance,Rule: New,Rule: Deprecation,Rule: Tuning,Hunt: New, orHunt: Tuningso guidelines can be generatedmeta:rapid-mergelabel if planning to merge within 24 hoursContributor checklist