feat(cloud-query): integrate Splunk connection support to cloud query#3350
Conversation
- Add SplunkConnection module and corresponding fields in toolquery Protobuf definitions - Update tool enums and schema definitions to include Splunk - Implement Splunk connection configuration changesets - Extend GraphQL types to support Splunk connection attributes
Greptile SummaryThis PR integrates Splunk as a new log-query data source across the full stack: a new Key changes:
Issues found:
Confidence Score: 4/5Safe to merge after addressing the unbounded empty-query scan risk; all prior P0/P1 concerns from previous review rounds have been resolved. All previously flagged critical issues (Bearer vs Splunk auth, scanner buffer too small, preview-result duplication, ghost entries from non-result lines, non-deterministic timestamps) are now correctly handled. One new P1 remains: an empty go/cloud-query/internal/tools/provider_splunk.go — empty-query guard in
|
| Filename | Overview |
|---|---|
| go/cloud-query/internal/tools/provider_splunk.go | Core Splunk log provider; previous P1 issues (preview filtering, 10 MB scanner buffer, ghost entries, non-deterministic timestamps) are all addressed; unbounded search on empty query is a remaining concern. |
| go/cloud-query/internal/tools/clients/splunk.go | New Splunk HTTP client; correctly uses Splunk auth scheme (not Bearer), opt-in InsecureSkipVerify via URL query param, and normalises the base URL before use. |
| go/cloud-query/internal/tools/clients/splunk_test.go | Tests normalizeSplunkURL only; no coverage for provider_splunk.go parsing/filtering logic. |
| go/cloud-query/internal/tools/provider.go | Splunk wired into newLogsProvider switch — clean and consistent with existing provider pattern. |
| lib/console/schema/workbench_tool.ex | Splunk schema added with encrypted credentials, auth validation (token or username/password required), and correct category inference (:logs). |
| lib/console/ai/workbench/conversion.ex | Splunk proto conversion added consistently with other providers, mapping all four connection fields. |
| go/cloud-query/api/proto/toolquery.proto | SplunkConnection message and splunk oneof case (field 6) added correctly to proto definition. |
Reviews (6): Last reviewed commit: "refactor(splunk): remove redundant token..." | Re-trigger Greptile
…dant JSON marshalling
- Introduce klog for informative logging when Splunk log timestamp is missing - Default to zero time to avoid errors in parsing routines when timestamp is empty
- Introduce Splunk connection types and attributes in GraphQL schema - Update Go client models to reflect Splunk integration - Expand tool enums to include Splunk
|
@greptileai review again |
- Add `Preview` field to `SplunkSearchResponse` structure - Skip processing of preview responses or those lacking essential fields (Message, Timestamp)
|
@greptileai all fixed, check again |
…nd increase scanner buffer size - Set both 'Authorization' headers for compatibility with older versions. - Increase scanner buffer size to 10MB in `toLogsQueryOutput` for handling larger responses.
|
@greptileai review again |
- Use klog to log errors instead of returning them. - Continue processing other items after logging an error.
- Remove redundant unit tests for `SplunkProvider` that are no longer needed.
…-workbench-splunk-logs-support
…ance label processing - Eliminate unnecessary token auth code for backwards compatibility. - Add logic to remove empty labels in `provider_splunk.go`. - Simplify `parseTime` function by changing input type to string.
|
@greptileai review |
Test Plan
Locally w/ plrl-dev-aws
Checklist
Plural Flow: console