-
Notifications
You must be signed in to change notification settings - Fork 47
[FEATURE] Add Splunk datasource plugin #543
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
Open
sharangokul28
wants to merge
1
commit into
perses:main
Choose a base branch
from
sharangokul28:feature/splunk-plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Splunk Plugin for Perses | ||
|
|
||
| ## Overview | ||
|
|
||
| The Splunk plugin enables Perses to connect to Splunk instances and query data using Splunk Processing Language (SPL). It supports both time series visualizations and log queries. | ||
|
|
||
| ## Features | ||
|
|
||
| - **Splunk Datasource**: Connect to Splunk Enterprise or Splunk Cloud instances | ||
| - **Time Series Queries**: Execute SPL queries for time series data visualization | ||
| - **Log Queries**: Retrieve and display log data from Splunk | ||
| - **Variable Support**: Use Perses variables in your SPL queries | ||
| - **Flexible Authentication**: Support for direct URL or proxy-based connections | ||
|
|
||
| ## SPL Query Examples | ||
|
|
||
| ### Time Series Examples | ||
|
|
||
| ```spl | ||
| # Count events over time | ||
| search index=main | timechart count | ||
|
|
||
| # Average response time by service | ||
| search index=web | timechart avg(response_time) by service | ||
|
|
||
| # Error rate over time | ||
| search index=main error | timechart count | ||
| ``` | ||
|
|
||
| ### Log Query Examples | ||
|
|
||
| ```spl | ||
| # Recent errors | ||
| search index=main error | head 100 | ||
|
|
||
| # Specific application logs | ||
| search index=app sourcetype=application:log level=ERROR | ||
|
|
||
| # Search with filters | ||
| search index=main host=server01 status=500 | ||
| ``` | ||
|
|
||
| ## API Endpoints | ||
|
|
||
| The plugin uses the following Splunk REST API endpoints: | ||
|
|
||
| - `/services/search/jobs` - Create search jobs | ||
| - `/services/search/jobs/{sid}` - Get job status | ||
| - `/services/search/jobs/{sid}/results` - Get search results | ||
| - `/services/search/jobs/{sid}/events` - Get search events | ||
| - `/services/search/jobs/export` - Export search results | ||
| - `/services/data/indexes` - Get index information | ||
|
|
||
| ## Authentication | ||
|
|
||
| Splunk authentication can be configured through: | ||
|
|
||
| - HTTP headers (Authorization token) | ||
| - Proxy settings with credentials | ||
| - Direct URL with embedded credentials (not recommended for production) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| module: "github.com/perses/plugins/splunk@v0" | ||
| language: { | ||
| version: "v0.15.1" | ||
| } | ||
| source: { | ||
| kind: "git" | ||
| } | ||
| deps: { | ||
| "github.com/perses/shared/cue@v0": { | ||
| v: "v0.53.0-rc.2" | ||
| default: true | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||
| module github.com/perses/plugins/splunk | ||||||
|
|
||||||
| go 1.25.1 | ||||||
|
|
||||||
| require github.com/perses/perses v0.53.0-rc.0 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| require ( | ||||||
| github.com/beorn7/perks v1.0.1 // indirect | ||||||
| github.com/cespare/xxhash/v2 v2.3.0 // indirect | ||||||
| github.com/go-jose/go-jose/v4 v4.1.3 // indirect | ||||||
| github.com/jpillora/backoff v1.0.0 // indirect | ||||||
| github.com/kr/text v0.2.0 // indirect | ||||||
| github.com/muhlemmer/gu v0.3.1 // indirect | ||||||
| github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect | ||||||
| github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect | ||||||
| github.com/prometheus/client_golang v1.23.2 // indirect | ||||||
| github.com/prometheus/client_model v0.6.2 // indirect | ||||||
| github.com/prometheus/common v0.67.2 // indirect | ||||||
| github.com/prometheus/procfs v0.17.0 // indirect | ||||||
| github.com/zitadel/oidc/v3 v3.45.0 // indirect | ||||||
| github.com/zitadel/schema v1.3.1 // indirect | ||||||
| go.yaml.in/yaml/v2 v2.4.3 // indirect | ||||||
| golang.org/x/net v0.46.0 // indirect | ||||||
| golang.org/x/oauth2 v0.33.0 // indirect | ||||||
| golang.org/x/sys v0.37.0 // indirect | ||||||
| golang.org/x/text v0.30.0 // indirect | ||||||
| google.golang.org/protobuf v1.36.10 // indirect | ||||||
| gopkg.in/yaml.v3 v3.0.1 // indirect | ||||||
| ) | ||||||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Copyright The Perses Authors | ||
| // Licensed under the Apache License, Version 2.0 (the \"License\"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an \"AS IS\" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| import type { Config } from '@jest/types'; | ||
| import shared from '../jest.shared'; | ||
|
|
||
| const jestConfig: Config.InitialOptions = { | ||
| ...shared, | ||
|
|
||
| setupFilesAfterEnv: [...(shared.setupFilesAfterEnv ?? []), '<rootDir>/src/setup-tests.ts'], | ||
| }; | ||
|
|
||
| export default jestConfig; |
Oops, something went wrong.
Oops, something went wrong.
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.
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.