Skip to content

Commit 7997593

Browse files
committed
[FEATURE] Splunk: new plugin for perses
Signed-off-by: Sharan Gokul <sharangokul@gmail.com>
1 parent f50d307 commit 7997593

45 files changed

Lines changed: 6208 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

splunk/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Splunk Plugin for Perses
2+
3+
## Overview
4+
5+
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.
6+
7+
## Features
8+
9+
- **Splunk Datasource**: Connect to Splunk Enterprise or Splunk Cloud instances
10+
- **Time Series Queries**: Execute SPL queries for time series data visualization
11+
- **Log Queries**: Retrieve and display log data from Splunk
12+
- **Variable Support**: Use Perses variables in your SPL queries
13+
- **Flexible Authentication**: Support for direct URL or proxy-based connections
14+
15+
## SPL Query Examples
16+
17+
### Time Series Examples
18+
19+
```spl
20+
# Count events over time
21+
search index=main | timechart count
22+
23+
# Average response time by service
24+
search index=web | timechart avg(response_time) by service
25+
26+
# Error rate over time
27+
search index=main error | timechart count
28+
```
29+
30+
### Log Query Examples
31+
32+
```spl
33+
# Recent errors
34+
search index=main error | head 100
35+
36+
# Specific application logs
37+
search index=app sourcetype=application:log level=ERROR
38+
39+
# Search with filters
40+
search index=main host=server01 status=500
41+
```
42+
43+
## API Endpoints
44+
45+
The plugin uses the following Splunk REST API endpoints:
46+
47+
- `/services/search/jobs` - Create search jobs
48+
- `/services/search/jobs/{sid}` - Get job status
49+
- `/services/search/jobs/{sid}/results` - Get search results
50+
- `/services/search/jobs/{sid}/events` - Get search events
51+
- `/services/search/jobs/export` - Export search results
52+
- `/services/data/indexes` - Get index information
53+
54+
## Authentication
55+
56+
Splunk authentication can be configured through:
57+
58+
- HTTP headers (Authorization token)
59+
- Proxy settings with credentials
60+
- Direct URL with embedded credentials (not recommended for production)

splunk/cue.mod/module.cue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module: "github.com/perses/plugins/splunk@v0"
2+
language: {
3+
version: "v0.15.1"
4+
}
5+
source: {
6+
kind: "git"
7+
}
8+
deps: {
9+
"github.com/perses/shared/cue@v0": {
10+
v: "v0.53.0-rc.1"
11+
default: true
12+
}
13+
}

splunk/go.mod

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module github.com/perses/plugins/splunk
2+
3+
go 1.25.1
4+
5+
require github.com/perses/perses v0.53.0-rc.0
6+
7+
require (
8+
github.com/beorn7/perks v1.0.1 // indirect
9+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
10+
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
11+
github.com/jpillora/backoff v1.0.0 // indirect
12+
github.com/kr/text v0.2.0 // indirect
13+
github.com/muhlemmer/gu v0.3.1 // indirect
14+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
15+
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
16+
github.com/prometheus/client_golang v1.23.2 // indirect
17+
github.com/prometheus/client_model v0.6.2 // indirect
18+
github.com/prometheus/common v0.67.2 // indirect
19+
github.com/prometheus/procfs v0.17.0 // indirect
20+
github.com/zitadel/oidc/v3 v3.45.0 // indirect
21+
github.com/zitadel/schema v1.3.1 // indirect
22+
go.yaml.in/yaml/v2 v2.4.3 // indirect
23+
golang.org/x/net v0.46.0 // indirect
24+
golang.org/x/oauth2 v0.33.0 // indirect
25+
golang.org/x/sys v0.37.0 // indirect
26+
golang.org/x/text v0.30.0 // indirect
27+
google.golang.org/protobuf v1.36.10 // indirect
28+
gopkg.in/yaml.v3 v3.0.1 // indirect
29+
)

splunk/jest.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { Config } from '@jest/types';
2+
import shared from '../jest.shared';
3+
4+
const jestConfig: Config.InitialOptions = {
5+
...shared,
6+
7+
setupFilesAfterEnv: [...(shared.setupFilesAfterEnv ?? []), '<rootDir>/src/setup-tests.ts'],
8+
};
9+
10+
export default jestConfig;

0 commit comments

Comments
 (0)