Skip to content

feat: add keyword and limit filters to discover-source-metadata#19

Merged
patrick204nqh merged 1 commit into
mainfrom
feat/discover-source-keyword-filter
Feb 11, 2026
Merged

feat: add keyword and limit filters to discover-source-metadata#19
patrick204nqh merged 1 commit into
mainfrom
feat/discover-source-keyword-filter

Conversation

@patrick204nqh
Copy link
Copy Markdown
Owner

Summary

  • Add -k/--keyword flag to filter discovery results by source name or category (case-insensitive substring match)
  • Add -l/--limit flag to cap the number of returned sources
  • Keyword is included in the JSON response for traceability

Details

The --filter flag modifies the Sumo Logic query itself (server-side scoping). The new --keyword flag is a client-side post-filter on the aggregation results, matching against both source name and category fields. This lets users quickly find sources like nginx without knowing the exact _sourceCategory pattern.

Files changed:

  • lib/sumologic/cli.rb — Added -k/--keyword and -l/--limit Thor options with examples
  • lib/sumologic/cli/commands/discover_source_metadata_command.rb — Pass keyword/limit, log keyword
  • lib/sumologic/metadata/source_metadata_discovery.rbfilter_by_keyword post-filter + limit
  • lib/sumologic/client.rb — Updated facade signature
  • spec/sumologic/metadata/source_metadata_discovery_spec.rb — New: 9 tests

Test plan

  • 9 new tests: keyword by name, keyword by category, case-insensitive, limit, keyword+limit combo, empty result, error handling
  • Full suite: 166/166 passing

Closes #10

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.
@patrick204nqh patrick204nqh force-pushed the feat/discover-source-keyword-filter branch from cd4e655 to c1f33cc Compare February 11, 2026 08:40
@patrick204nqh patrick204nqh merged commit 885f62f into main Feb 11, 2026
2 checks passed
@patrick204nqh patrick204nqh deleted the feat/discover-source-keyword-filter branch February 11, 2026 08:40
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.

Add keyword/filter support to discover-source-metadata

1 participant