feat: add keyword and limit filters to discover-source-metadata#19
Merged
Conversation
Add -k/--keyword flag to filter discovery results by source name or category (case-insensitive substring match), and -l/--limit to cap the number of returned sources. The keyword filter is applied client-side after the aggregation query completes, so it does not reduce API usage but makes the output much easier to work with. Closes #10.
cd4e655 to
c1f33cc
Compare
3 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.
Summary
-k/--keywordflag to filter discovery results by source name or category (case-insensitive substring match)-l/--limitflag to cap the number of returned sourcesDetails
The
--filterflag modifies the Sumo Logic query itself (server-side scoping). The new--keywordflag is a client-side post-filter on the aggregation results, matching against both sourcenameandcategoryfields. This lets users quickly find sources likenginxwithout knowing the exact_sourceCategorypattern.Files changed:
lib/sumologic/cli.rb— Added-k/--keywordand-l/--limitThor options with exampleslib/sumologic/cli/commands/discover_source_metadata_command.rb— Pass keyword/limit, log keywordlib/sumologic/metadata/source_metadata_discovery.rb—filter_by_keywordpost-filter + limitlib/sumologic/client.rb— Updated facade signaturespec/sumologic/metadata/source_metadata_discovery_spec.rb— New: 9 testsTest plan
Closes #10