Skip to content

Commit 6b85952

Browse files
authoredOct 21, 2024··
Merge pull request #28 from K-Yo/27-configuration-support-several-splunk-servers-and-define-their-roles
27 configuration support several splunk servers and define their roles
2 parents 2a3df6e + eaa2966 commit 6b85952

16 files changed

+253
-78
lines changed
 

‎.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
go.work
2222

2323
# runtime files
24-
splunk_exporter.yml
25-
/splunk_exporter
24+
/splunk_exporter.yml
25+
/splunk_exporter
26+
deploy/default.yml

‎README.md

+28-11
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You will need a configuration file, follow [`splunk_exporter_example.yml`](./spl
1717
You need docker compose installed, a bash helper is provided to start the exporter and the whole test bench as a [docker compose environment](./deploy/README.md).
1818

1919
```shell
20-
cd /deploy
20+
cd deploy/
2121
bash run.sh
2222
```
2323

@@ -27,27 +27,44 @@ To stop it:
2727
docker compose down
2828
```
2929

30-
## 🙋 Contribute
30+
## 👷 Contribute
3131

3232
After doing some changes, possible to re-deploy splunk_exporter with the following command
3333
```shell
3434
docker compose up -d --build splunk_exporter
3535
```
3636

37+
## 🛠️ Configuration
38+
39+
Splunk exporter needs to access management APIs
40+
See an example configuration file in [`splunk_exporter_example.yml`](./splunk_exporter_example.yml).
41+
3742
## 📏 metrics
3843

3944
All metrics are **Gauge**.
4045

4146
### from API
4247

43-
| Prefix | Description |
44-
| ------------------------------------------------------ | ------------------------------------------------- |
45-
| `splunk_exporter_index_` | Numerical data coming from data/indexes endpoint. |
46-
| `splunk_exporter_indexer_throughput_bytes_per_seconds` | average data throughput in indexer |
47-
| `splunk_exporter_metric_` | Export from metric indexes |
48-
| `splunk_exporter_health_splunkd` | Health status from local splunkd |
49-
| `splunk_exporter_health_deployment` | Health status from deployment |
48+
| Prefix | Labels | Description |
49+
| ------------------------------------------------------ | ----------------------------- | ------------------------------------------------- |
50+
| `splunk_exporter_index_` | `index_name` | Numerical data coming from data/indexes endpoint. |
51+
| `splunk_exporter_indexer_throughput_bytes_per_seconds` | _None_ | Average data throughput in indexer |
52+
| `splunk_exporter_metric_` | Dimensions returned by Splunk | Export from metric indexes |
53+
| `splunk_exporter_health_splunkd` | `name` | Health status from local splunkd |
54+
| `splunk_exporter_health_deployment` | `instance_id`, `name` | Health status from deployment |
55+
56+
## 🧑‍🔬 Testing
57+
58+
```shell
59+
go test -v ./...
60+
```
5061

51-
## ⛔ Limitations
62+
## ✨ Roadmap
5263

53-
Currently, only one splunk instance is supported
64+
| Item | Status |
65+
| --------------------- | ----------------- |
66+
| Metrics indexes | ✅ Done |
67+
| Indexes metrics | 🕰️ Ongoing |
68+
| Savedsearches metrics | 🔜 Next |
69+
| System metrics | ❓ Not planned yet |
70+
| Ingestion pipeline | ❓ Not planned yet |

‎config/config.go

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ type Metric struct {
1919
type Config struct {
2020
URL string `yaml:"url"`
2121
Token string `yaml:"token"`
22+
Username string `yaml:"username"`
23+
Password string `yaml:"password"`
2224
Insecure bool `yaml:"insecure"` // defaults to false
2325
Metrics []Metric `yaml:"metrics"`
2426
}
@@ -61,6 +63,7 @@ func (sc *SafeConfig) ReloadConfig(confFile string, logger log.Logger) (err erro
6163
return fmt.Errorf("error reading config file: %s", err)
6264
}
6365
defer yamlReader.Close()
66+
6467
decoder := yaml.NewDecoder(yamlReader)
6568
decoder.KnownFields(true)
6669

‎config/config_test.go

+35-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,43 @@ import (
66
"github.com/prometheus/client_golang/prometheus"
77
)
88

9-
func TestLoadConfig(t *testing.T) {
9+
// TestLoadConfigToken
10+
// Given
11+
//
12+
// A valid config file using a token
13+
//
14+
// When
15+
//
16+
// reloading the config
17+
//
18+
// Then
19+
//
20+
// Config reload happens without error
21+
func TestLoadConfigToken(t *testing.T) {
1022
sc := NewSafeConfig(prometheus.NewRegistry())
1123

12-
err := sc.ReloadConfig("testdata/splunk_exporter-good.yml", nil)
24+
err := sc.ReloadConfig("testdata/splunk_exporter-token-good.yml", nil)
25+
if err != nil {
26+
t.Errorf("Error loading config %v: %v", "splunk_exporter-good.yml", err)
27+
}
28+
}
29+
30+
// TestLoadConfigUser
31+
// Given
32+
//
33+
// A valid config file using a username and password
34+
//
35+
// When
36+
//
37+
// reloading the config
38+
//
39+
// Then
40+
//
41+
// Config reload happens without error
42+
func TestLoadConfigUser(t *testing.T) {
43+
sc := NewSafeConfig(prometheus.NewRegistry())
44+
45+
err := sc.ReloadConfig("testdata/splunk_exporter-user-good.yml", nil)
1346
if err != nil {
1447
t.Errorf("Error loading config %v: %v", "splunk_exporter-good.yml", err)
1548
}

‎deploy/splunk_exporter.yml.src ‎config/testdata/splunk_exporter-user-good.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
url: https://splunk:8089
2-
token: '${SPLUNK_TOKEN}'
2+
username: toto
3+
password: tutu
34
insecure: true
45
metrics:
56
- index: _metrics

‎deploy/docker-compose.yml

+44-7
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,55 @@ services:
5555
command: /splunk_exporter --config.file /splunk_exporter.yml --log.level=debug
5656
# add /etc/ssl/certs/ca-certificates.crt if needed
5757

58+
# splunk:
59+
# image: splunk/splunk:9.2
60+
# restart: unless-stopped
61+
# container_name: splunk
62+
# environment:
63+
# - SPLUNK_START_ARGS=--accept-license
64+
# - SPLUNK_PASSWORD=splunkadmin
65+
# expose:
66+
# - 8000
67+
# - 8089
68+
# ports:
69+
# - 8000:8000
70+
# - 8089:8089
71+
# networks:
72+
# - monitoring
73+
5874
splunk:
59-
image: splunk/splunk:9.2
60-
restart: unless-stopped
6175
container_name: splunk
76+
networks:
77+
monitoring:
78+
aliases:
79+
- splunk
80+
image: ${SPLUNK_IMAGE:-splunk/splunk:latest}
81+
hostname: splunk
6282
environment:
6383
- SPLUNK_START_ARGS=--accept-license
84+
- SPLUNK_STANDALONE_URL=splunk
85+
- DEBUG=true
6486
- SPLUNK_PASSWORD=splunkadmin
65-
expose:
87+
ports:
6688
- 8000
6789
- 8089
68-
ports:
69-
- 8000:8000
70-
- 8089:8089
90+
91+
dmc:
92+
container_name: dmc
7193
networks:
72-
- monitoring
94+
monitoring:
95+
aliases:
96+
- dmc
97+
image: ${SPLUNK_IMAGE:-splunk/splunk:latest}
98+
command: start
99+
hostname: dmc
100+
environment:
101+
- SPLUNK_START_ARGS=--accept-license
102+
- SPLUNK_STANDALONE_URL=splunk
103+
- SPLUNK_ROLE=splunk_monitor
104+
- SPLUNK_LICENSE_URI
105+
- SPLUNK_PASSWORD=splunkadmin
106+
- DEBUG=true
107+
ports:
108+
- 8000
109+
- 8089

‎deploy/run.sh

+6-13
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,12 @@ set -e
55
# print commands
66
set -v
77

8-
# initiate conf file
9-
touch ./splunk_exporter.yml
10-
118
# Start the stack
12-
docker compose up -d prometheus grafana splunk
13-
14-
# Wait for splunk to be initialized
15-
until docker logs -n1 splunk 2>/dev/null | grep -q -m 1 '^Ansible playbook complete'; do sleep 0.2; done
16-
17-
# Generate api key
18-
export SPLUNK_TOKEN=$(curl -k -u admin:splunkadmin -X POST https://localhost:8089/services/authorization/tokens?output_mode=json --data name=admin --data audience=splunk_exporter | jq -r '.entry[0].content.token')
19-
cat splunk_exporter.yml.src | envsubst > splunk_exporter.yml
9+
export SPLUNK_IMAGE="splunk/splunk:9.3"
10+
docker run --rm -it ${SPLUNK_IMAGE:-splunk/splunk:latest} create-defaults > default.yml
11+
docker compose up -d --remove-orphans
2012

21-
# start splunk_exporter
22-
docker compose up -d
13+
# Please wait for Splunk to be initialized, check this with the command:
14+
# docker compose logs dmc -f
15+
# If you need to reload config, you may use the following command:
2316
# curl -X POST http://localhost:9115/-/reload

‎deploy/splunk_exporter.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
url: https://dmc:8089
2+
username: admin
3+
password: splunkadmin
4+
insecure: true
5+
metrics:
6+
- index: _metrics
7+
name: spl.intr.disk_objects.Indexes.data.total_event_count
8+
- index: _metrics
9+
name: spl.intr.disk_objects.Indexes.data.total_bucket_count

‎exporter/exporter.go

+52-17
Original file line numberDiff line numberDiff line change
@@ -42,46 +42,81 @@ type Exporter struct {
4242
}
4343

4444
func (e *Exporter) UpdateConf(conf *config.Config) {
45-
// FIXME need to re-validate params
46-
e.splunk.Client.TLSInsecureSkipVerify = conf.Insecure
47-
e.splunk.Client.URL = conf.URL
48-
e.splunk.Client.Authenticator = authenticators.Token{
49-
Token: conf.Token,
45+
46+
opts := SplunkOpts{
47+
URI: conf.URL,
48+
Token: conf.Token,
49+
Username: conf.Username,
50+
Password: conf.Password,
51+
Insecure: conf.Insecure,
52+
}
53+
54+
client, err := getSplunkClient(opts, e.logger)
55+
56+
if err != nil {
57+
level.Error(e.logger).Log("msg", "Could not get Splunk client", "err", err)
5058
}
59+
e.splunk.Client = client
5160
}
5261

5362
type SplunkOpts struct {
5463
URI string
5564
Token string
65+
Username string
66+
Password string
5667
Insecure bool
5768
}
5869

59-
// New creates a new exporter for Splunk metrics
60-
func New(opts SplunkOpts, logger log.Logger, metricsConf []config.Metric) (*Exporter, error) {
70+
// getSplunkClient generates a Splunk client from parameters
71+
// this function validates parameters and returns an error if they are not valid.
72+
func getSplunkClient(opts SplunkOpts, logger log.Logger) (*splunkclient.Client, error) {
6173

62-
uri := opts.URI
63-
if !strings.Contains(uri, "://") {
64-
uri = "https://" + uri
74+
if !strings.Contains(opts.URI, "://") {
75+
opts.URI = "https://" + opts.URI
6576
}
66-
u, err := url.Parse(uri)
77+
u, err := url.Parse(opts.URI)
6778
if err != nil {
6879
return nil, fmt.Errorf("invalid splunk URL: %s", err)
6980
}
7081
if u.Host == "" || (u.Scheme != "http" && u.Scheme != "https") {
71-
return nil, fmt.Errorf("invalid splunk URL: %s", uri)
82+
return nil, fmt.Errorf("invalid splunk URL: %s", opts.URI)
7283
}
7384

74-
authenticator := authenticators.Token{
75-
Token: opts.Token,
85+
var authenticator splunkclient.Authenticator
86+
if len(opts.Token) > 0 {
87+
level.Info(logger).Log("msg", "Token is defined, we will use it for authentication.")
88+
authenticator = authenticators.Token{
89+
Token: opts.Token,
90+
}
91+
} else {
92+
level.Info(logger).Log("msg", "Token is not defined, we will use password authentication.", "username", opts.Username)
93+
if len(opts.Password) == 0 {
94+
level.Warn(logger).Log("msg", "Password seems to be undefined.")
95+
}
96+
authenticator = &authenticators.Password{
97+
Username: opts.Username,
98+
Password: opts.Password,
99+
}
76100
}
77101
client := splunkclient.Client{
78102
URL: opts.URI,
79103
Authenticator: authenticator,
80104
TLSInsecureSkipVerify: opts.Insecure,
81105
}
106+
return &client, nil
107+
}
108+
109+
// New creates a new exporter for Splunk metrics
110+
func New(opts SplunkOpts, logger log.Logger, metricsConf []config.Metric) (*Exporter, error) {
111+
112+
client, err := getSplunkClient(opts, logger)
113+
114+
if err != nil {
115+
level.Error(logger).Log("msg", "Could not get Splunk client", "err", err)
116+
}
82117

83118
spk := splunklib.Splunk{
84-
Client: &client,
119+
Client: client,
85120
Logger: logger,
86121
}
87122

@@ -126,13 +161,13 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
126161
// collectConfiguredMetrics gets metric measures from splunk indexes as specified by configuration
127162
func (e *Exporter) collectConfiguredMetrics(ch chan<- prometheus.Metric) bool {
128163

129-
return e.indexedMetrics.ProcessMeasures(ch)
164+
return e.indexedMetrics.CollectMeasures(ch)
130165

131166
}
132167

133168
// collectHealthMetrics grabs metrics from Splunk Health endpoints
134169
func (e *Exporter) collectHealthMetrics(ch chan<- prometheus.Metric) bool {
135-
return e.healthMetrics.ProcessMeasures(ch)
170+
return e.healthMetrics.CollectMeasures(ch)
136171
}
137172

138173
func (e *Exporter) collectIndexerMetrics(ch chan<- prometheus.Metric) bool {

‎exporter/exporter_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package exporter
2+
3+
// We shall test properly metrics being collected (from testdata/deploymenthealth.json for example).
4+
// We’re waiting for https://github.com/prometheus/client_golang/issues/1639 to be resolved for this.

‎exporter/health_manager.go

+32-12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package exporter
22

33
import (
44
"fmt"
5+
"strings"
56

67
splunklib "github.com/K-Yo/splunk_exporter/splunk"
78
"github.com/go-kit/log"
@@ -33,15 +34,15 @@ func newHealthManager(namespace string, spk *splunklib.Splunk, logger log.Logger
3334
deploymentDescriptor: prometheus.NewDesc(
3435
prometheus.BuildFQName(namespace, "health", "deployment"),
3536
"Splunk exported metric from deployment health API",
36-
[]string{"name"}, nil,
37+
[]string{"name", "instance_id"}, nil,
3738
),
3839
}
3940

4041
level.Debug(logger).Log("msg", "Done initiating health manager")
4142
return &hm
4243
}
4344

44-
func (hm *HealthManager) ProcessMeasures(ch chan<- prometheus.Metric) bool {
45+
func (hm *HealthManager) CollectMeasures(ch chan<- prometheus.Metric) bool {
4546

4647
// collect splunkd health metrics
4748
level.Info(hm.logger).Log("msg", "Collecting Splunkd Health measures")
@@ -51,7 +52,7 @@ func (hm *HealthManager) ProcessMeasures(ch chan<- prometheus.Metric) bool {
5152
return false
5253
}
5354

54-
ret := hm.getMetricsSplunkd(ch, "", &splunkdHealth.Content)
55+
ret := hm.collectMetricsSplunkd(ch, "", &splunkdHealth.Content)
5556

5657
level.Info(hm.logger).Log("msg", "Done collecting Splunkd Health measures")
5758

@@ -65,15 +66,15 @@ func (hm *HealthManager) ProcessMeasures(ch chan<- prometheus.Metric) bool {
6566
return false
6667
}
6768

68-
ret = ret && hm.getMetricsDeployment(ch, "", deploymentHealth.Content.Features)
69+
ret = ret && hm.collectMetricsDeployment(ch, "", deploymentHealth.Content.Features)
6970
level.Info(hm.logger).Log("msg", "Done collecting Deployment Health measures")
7071

7172
return ret
7273
}
7374

74-
// getMetricsSplunkd recursively get all metric measures from a health endpoint result and sends them in the channel
75+
// collectMetricsSplunkd recursively get all metric measures from a health endpoint result and sends them in the channel
7576
// disabled features are not measured
76-
func (hm *HealthManager) getMetricsSplunkd(ch chan<- prometheus.Metric, path string, fh *splunklib.FeatureHealth) bool {
77+
func (hm *HealthManager) collectMetricsSplunkd(ch chan<- prometheus.Metric, path string, fh *splunklib.FeatureHealth) bool {
7778
ret := true
7879
if !fh.Disabled {
7980
healthValue, err := hm.healthToFloat(fh.Health)
@@ -91,16 +92,16 @@ func (hm *HealthManager) getMetricsSplunkd(ch chan<- prometheus.Metric, path str
9192
}
9293

9394
for name, child := range fh.Features {
94-
ret = ret && hm.getMetricsSplunkd(ch, fmt.Sprintf("%s/%s", path, name), &child)
95+
ret = ret && hm.collectMetricsSplunkd(ch, fmt.Sprintf("%s/%s", path, name), &child)
9596
}
9697

9798
return ret
9899

99100
}
100101

101-
// getMetricsDeployment recursively get all metric measures from a health endpoint result and sends them in the channel
102+
// collectMetricsDeployment recursively get all metric measures from a health endpoint result and sends them in the channel
102103
// disabled features are not measured
103-
func (hm *HealthManager) getMetricsDeployment(ch chan<- prometheus.Metric, path string, data map[string]interface{}) bool {
104+
func (hm *HealthManager) collectMetricsDeployment(ch chan<- prometheus.Metric, path string, data map[string]interface{}) bool {
104105
level.Debug(hm.logger).Log("msg", "Getting Deployment metrics", "path", path)
105106
ret := true
106107
var disabled bool = false
@@ -132,15 +133,24 @@ func (hm *HealthManager) getMetricsDeployment(ch chan<- prometheus.Metric, path
132133
case map[string]interface{}:
133134
newPath := fmt.Sprintf("%s/%s", path, key)
134135
// recursively get lower level metrics
135-
ret = ret && hm.getMetricsDeployment(ch, newPath, v)
136+
ret = ret && hm.collectMetricsDeployment(ch, newPath, v)
136137
default:
137138
level.Error(hm.logger).Log("msg", "unknown type for key", "key", key, "path", path)
138139
}
139140
}
140141
level.Debug(hm.logger).Log("num_red", num_red, "num_yellow", num_yellow)
141142

143+
skipMetric := false
144+
level.Debug(hm.logger).Log("path", path, "lenpath", len(path))
145+
skipMetric = skipMetric || disabled // ignore disabled metrics
146+
skipMetric = skipMetric || health == "" // ignore when we cannot parse health
147+
148+
// ignore when it’s a metric ending with "/instances"
149+
if len(path) > 10 {
150+
skipMetric = skipMetric || (path[len(path)-10:] == "/instances")
151+
}
142152
// Add current metric
143-
if !disabled && health != "" {
153+
if !skipMetric {
144154
healthValue, err := hm.healthToFloat(health)
145155
if err != nil {
146156
level.Error(hm.logger).Log("msg", "Cannot get metrics because of unknown health value", "path", path, "err", err)
@@ -151,8 +161,18 @@ func (hm *HealthManager) getMetricsDeployment(ch chan<- prometheus.Metric, path
151161
displayPath = "/"
152162
}
153163

164+
// process when metrics are in the form of /splunkd/resource_usage/iowait/sum_top3_cpu_percs__max_last_3m/instances/8F8096AF-A456-4974-92FB-966103FA9752
165+
instanceId := ""
166+
if strings.Contains(path, "/instances/") {
167+
parts := strings.Split(path, "/")
168+
if parts[len(parts)-2] == "instances" {
169+
instanceId = parts[len(parts)-1]
170+
}
171+
displayPath = strings.Join(parts[:len(parts)-2], "/")
172+
}
173+
154174
ch <- prometheus.MustNewConstMetric(
155-
hm.deploymentDescriptor, prometheus.GaugeValue, healthValue, displayPath,
175+
hm.deploymentDescriptor, prometheus.GaugeValue, healthValue, displayPath, instanceId,
156176
)
157177
}
158178

‎exporter/health_manager_test.go

+24-8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package exporter
22

33
import (
44
"encoding/json"
5+
"fmt"
56
"os"
67
"testing"
78

@@ -14,10 +15,12 @@ import (
1415

1516
func TestDeployment(t *testing.T) {
1617
_, w, _ := os.Pipe()
18+
defer w.Close()
19+
1720
logger := log.NewJSONLogger(w)
1821
hm := HealthManager{
1922
logger: logger,
20-
deploymentDescriptor: prometheus.NewDesc("metric", "", []string{"name"}, nil),
23+
deploymentDescriptor: prometheus.NewDesc("metric", "", []string{"name", "instance_id"}, nil),
2124
}
2225

2326
var deploymentHealth splunklib.HealthDeploymentDetails
@@ -27,12 +30,25 @@ func TestDeployment(t *testing.T) {
2730

2831
json.Unmarshal(fileContent, &deploymentHealth)
2932

30-
ret := hm.getMetricsDeployment(
31-
make(chan<- prometheus.Metric),
32-
"",
33-
deploymentHealth.Content.Features,
34-
)
35-
36-
assert.True(t, ret)
33+
ch := make(chan prometheus.Metric)
34+
35+
// launch collector
36+
go func() {
37+
ret := hm.collectMetricsDeployment(
38+
ch,
39+
"",
40+
deploymentHealth.Content.Features,
41+
)
42+
close(ch)
43+
44+
assert.True(t, ret)
45+
}()
46+
47+
// empty chan
48+
go func() {
49+
for x := <-ch; x != nil; x = <-ch {
50+
fmt.Fprintln(os.Stdout, x)
51+
}
52+
}()
3753

3854
}

‎exporter/metrics_manager.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ func (mm *MetricsManager) Add(metric config.Metric) {
4343

4444
}
4545

46-
// ProcessMeasures will get all measures and send generated metrics in channel
46+
// CollectMeasures will get all measures and send generated metrics in channel
4747
// returns true if everything went well
48-
func (mm *MetricsManager) ProcessMeasures(ch chan<- prometheus.Metric) bool {
48+
func (mm *MetricsManager) CollectMeasures(ch chan<- prometheus.Metric) bool {
4949
level.Info(mm.logger).Log("msg", "Getting custom measures")
5050

5151
processMetricCallback := func(measure splunklib.MetricMeasure, descriptor *prometheus.Desc) error {
@@ -81,7 +81,7 @@ func (mm *MetricsManager) ProcessOneMeasure(key string, callback func(splunklib.
8181
level.Error(mm.logger).Log("msg", "Unknown metric name, this should not happen", "name", key)
8282
}
8383
if metric.Desc == nil {
84-
level.Debug(mm.logger).Log("msg", "First time seing this metric, will create desc for it.", "name", key)
84+
level.Debug(mm.logger).Log("msg", "First time seeing this metric, will create desc for it.", "name", key)
8585

8686
name := mm.normalizeName(metric.Name)
8787
labelsMap, labelsPromNames := mm.getLabels(metric)

‎main.go

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ func run() int {
7171
opts := exporter.SplunkOpts{
7272
URI: sc.C.URL,
7373
Token: sc.C.Token,
74+
Username: sc.C.Username,
75+
Password: sc.C.Password,
7476
Insecure: sc.C.Insecure,
7577
}
7678
exp, err := exporter.New(opts, logger, sc.C.Metrics)

‎splunk_exporter_example.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# Splunk API endpoint
1+
2+
# Monitoring console (or Search Head)
23
url: https://localhost:8089
34

45
# Splunk API key
56
token: '<insert api key>'
7+
# OR
8+
user: 'changeme'
9+
password: 'changeme'
610

711
# should we skip TLS validation ?
812
insecure: false
@@ -16,4 +20,4 @@ metrics:
1620
- index: _metrics
1721
name: spl.mlog.searchscheduler.max_lag
1822
- index: _metrics
19-
name: spl.mlog.searchscheduler.skipped
23+
name: spl.mlog.searchscheduler.skipped

0 commit comments

Comments
 (0)
Please sign in to comment.