Skip to content

Commit 003187f

Browse files
committed
JOBS-1114 - The metric and log index names are now configurable
1 parent 682f7ef commit 003187f

10 files changed

Lines changed: 54 additions & 16 deletions

File tree

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,29 @@ Our integration uses the [Splunk HEC](https://dev.splunk.com/enterprise/docs/dat
5252

5353
Users will need to configure the HEC to accept data (enabled) and also create a new token. Steps are below.
5454

55-
#### Create index jfrog_splunk
55+
#### Create index for logs (default: jfrog_splunk)
5656

5757
```text
5858
1. Open Splunk web console as administrator
5959
2. Click on "Settings" in dropdown select "Indexes"
6060
3. Click on "New Index"
61-
4. Enter Index name as jfrog_splunk
61+
4. Enter Index name as jfrog_splunk (or your custom name)
6262
5. Click "Save"
6363
```
6464

65-
#### Create index jfrog_splunk_metrics
65+
#### Create index for metrics (default: jfrog_splunk_metrics)
6666

6767
```text
6868
1. Open Splunk web console as administrator
6969
2. Click on "Settings" in dropdown select "Indexes"
7070
3. Click on "New Index"
71-
4. Enter Index name as jfrog_splunk_metrics
71+
4. Enter Index name as jfrog_splunk_metrics (or your custom name)
7272
5. Select Index Data Type as Metrics
7373
6. Click "Save"
7474
```
7575

76+
**Note:** You can customize the index names by setting the `SPLUNK_LOGS_INDEX` and `SPLUNK_METRICS_INDEX` environment variables in your docker.env file.
77+
7678
#### Configure new HEC token to receive Logs
7779

7880
```text
@@ -83,7 +85,7 @@ Users will need to configure the HEC to accept data (enabled) and also create a
8385
5. Enter a "Name" in the textbox
8486
6. (Optional) Enter a "Description" in the textbox
8587
7. Click on the green "Next" button
86-
8. Add "jfrog_splunk" index to store the JFrog platform log data into.
88+
8. Add "jfrog_splunk" (or your custom logs index name) to store the JFrog platform log data into.
8789
9. Click on the green "Review" button
8890
10. If good, Click on the green "Done" button
8991
11. Save the generated token value
@@ -99,7 +101,7 @@ Users will need to configure the HEC to accept data (enabled) and also create a
99101
5. Enter a "Name" in the textbox
100102
6. (Optional) Enter a "Description" in the textbox
101103
7. Click on the green "Next" button
102-
8. Add "jfrog_splunk_metrics" index to store the JFrog platform metrics data into.
104+
8. Add "jfrog_splunk_metrics" (or your custom metrics index name) to store the JFrog platform metrics data into.
103105
9. Click on the green "Review" button
104106
10. If good, Click on the green "Done" button
105107
11. Save the generated token value
@@ -176,6 +178,8 @@ We rely heavily on environment variables so that the correct log files are strea
176178
* **SPLUNK_HEC_PORT**: Splunk HEC configured port
177179
* **SPLUNK_HEC_TOKEN**: Splunk HEC Token for sending logs to Splunk
178180
* **SPLUNK_METRICS_HEC_TOKEN**: Splunk HEC Token for sending metrics to Splunk
181+
* **SPLUNK_LOGS_INDEX**: Splunk index name for storing logs (default: jfrog_splunk)
182+
* **SPLUNK_METRICS_INDEX**: Splunk index name for storing metrics (default: jfrog_splunk_metrics)
179183
* **SPLUNK_INSECURE_SSL**: false for test environments only or if http scheme
180184
* **SPLUNK_VERIFY_SSL**: false for disabling ssl validation (useful for proxy forwarding or bypassing ssl certificate validation)
181185
* **SPLUNK_COMPRESS_DATA**: true for compressing logs and metrics json payloads on outbound to Splunk
@@ -349,6 +353,8 @@ export MASTER_KEY=$(openssl rand -hex 32)
349353
--set splunk.port=$SPLUNK_HEC_PORT \
350354
--set splunk.logs_token=$SPLUNK_HEC_TOKEN \
351355
--set splunk.metrics_token=$SPLUNK_METRICS_HEC_TOKEN \
356+
--set splunk.logs_index=$SPLUNK_LOGS_INDEX \
357+
--set splunk.metrics_index=$SPLUNK_METRICS_INDEX \
352358
--set splunk.compress_data=$SPLUNK_COMPRESS_DATA \
353359
--set splunk.com_protocol=$SPLUNK_COM_PROTOCOL \
354360
--set splunk.insecure_ssl=$SPLUNK_INSECURE_SSL \
@@ -425,6 +431,8 @@ export MASTER_KEY=$(openssl rand -hex 32)
425431
--set splunk.port=$SPLUNK_HEC_PORT \
426432
--set splunk.logs_token=$SPLUNK_HEC_TOKEN \
427433
--set splunk.metrics_token=$SPLUNK_METRICS_HEC_TOKEN \
434+
--set splunk.logs_index=$SPLUNK_LOGS_INDEX \
435+
--set splunk.metrics_index=$SPLUNK_METRICS_INDEX \
428436
--set splunk.com_protocol=$SPLUNK_COM_PROTOCOL \
429437
--set splunk.insecure_ssl=$SPLUNK_INSECURE_SSL \
430438
--set splunk.verify_ssl=$SPLUNK_VERIFY_SSL \
@@ -456,6 +464,8 @@ For Xray installation, download the .env file from [here](https://raw.githubuser
456464
* **SPLUNK_HEC_PORT**: Splunk HEC configured port
457465
* **SPLUNK_HEC_TOKEN**: Splunk HEC Token for sending logs to Splunk
458466
* **SPLUNK_METRICS_HEC_TOKEN**: Splunk HEC Token for sending metrics to Splunk
467+
* **SPLUNK_LOGS_INDEX**: Splunk index name for storing logs (default: jfrog_splunk)
468+
* **SPLUNK_METRICS_INDEX**: Splunk index name for storing metrics (default: jfrog_splunk_metrics)
459469
* **SPLUNK_INSECURE_SSL**: false for test environments only or if http scheme
460470
* **SPLUNK_VERIFY_SSL**: false for disabling ssl validation (useful for proxy forwarding or bypassing ssl certificate validation)
461471
* **SPLUNK_COMPRESS_DATA**: true for compressing logs and metrics json payloads on outbound to Splunk
@@ -487,6 +497,8 @@ helm upgrade --install xray jfrog/xray --set xray.jfrogUrl=$JPD_URL \
487497
--set splunk.port=$SPLUNK_HEC_PORT \
488498
--set splunk.logs_token=$SPLUNK_HEC_TOKEN \
489499
--set splunk.metrics_token=$SPLUNK_METRICS_HEC_TOKEN \
500+
--set splunk.logs_index=$SPLUNK_LOGS_INDEX \
501+
--set splunk.metrics_index=$SPLUNK_METRICS_INDEX \
490502
--set splunk.com_protocol=$SPLUNK_COM_PROTOCOL \
491503
--set splunk.insecure_ssl=$SPLUNK_INSECURE_SSL \
492504
--set splunk.verify_ssl=$SPLUNK_VERIFY_SSL \

app/jfrog-logs/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
Install the app in your Splunk instance. Then restart your Splunk instance by going to _Server Controls > Restart_.
55

66
## Splunk Setup
7-
1. Create new Events index `jfrog_splunk` at _Settings > Indexes > New Index > Save_
8-
2. Create new Metrics index `jfrog_splunk_metrics` at _Settings > Indexes > New Index > Metrics > Save_
7+
1. Create new Events index `jfrog_splunk` (or your custom name) at _Settings > Indexes > New Index > Save_
8+
2. Create new Metrics index `jfrog_splunk_metrics` (or your custom name) at _Settings > Indexes > New Index > Metrics > Save_
99
3. Create a new HTTP Event Collector data input for logs at _Settings > Data Inputs > HTTP Event Collector > New Token > jfrog_splunk index > Save_
1010
4. Create a new HTTP Event Collector data input for metrics at _Settings > Data Inputs > HTTP Event Collector > New Token > jfrog_splunk_metrics index > Save_
1111

12+
**Note:** You can customize the index names by setting the `SPLUNK_LOGS_INDEX` and `SPLUNK_METRICS_INDEX` environment variables in your configuration.
13+
1214
## Setup Fluentd
1315
FluentD is used to send log events to Splunk. This [repo](https://github.com/jfrog/log-analytics-splunk) contains instructions on various installations options for Fluentd as a logging agent.
1416

@@ -21,6 +23,8 @@ export SPLUNK_HEC_HOST=splunk.example.com
2123
export SPLUNK_HEC_PORT=8088
2224
export SPLUNK_HEC_TOKEN=SPLUNK_HEC_TOKEN
2325
export SPLUNK_METRICS_HEC_TOKEN=SPLUNK_METRICS_HEC_TOKEN
26+
export SPLUNK_LOGS_INDEX=jfrog_splunk
27+
export SPLUNK_METRICS_INDEX=jfrog_splunk_metrics
2428
export SPLUNK_INSECURE_SSL=false
2529
export SPLUNK_VERIFY_SSL=true
2630
export SPLUNK_COMPRESS_DATA=true
@@ -36,6 +40,8 @@ export COMMON_JPD=false
3640
* **SPLUNK_HEC_PORT**: Splunk HEC configured port
3741
* **SPLUNK_HEC_TOKEN**: Splunk HEC Token for sending logs to Splunk
3842
* **SPLUNK_METRICS_HEC_TOKEN**: Splunk HEC Token for sending metrics to Splunk
43+
* **SPLUNK_LOGS_INDEX**: Splunk index name for storing logs (default: jfrog_splunk)
44+
* **SPLUNK_METRICS_INDEX**: Splunk index name for storing metrics (default: jfrog_splunk_metrics)
3945
* **SPLUNK_INSECURE_SSL**: false for test environments only or if http scheme
4046
* **SPLUNK_VERIFY_SSL**: false for disabling ssl validation (useful for proxy forwarding or bypassing ssl certificate validation)
4147
* **SPLUNK_COMPRESS_DATA**: true for compressing logs and metrics json payloads on outbound to Splunk

app/jfrog-logs/default/macros.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[default_index]
2-
definition = index="jfrog_splunk"
2+
definition = index="$SPLUNK_LOGS_INDEX$"
33
iseval = 0
44

55
[default_metrics_index]
6-
definition = "index"="jfrog_splunk_metrics"
6+
definition = "index"="$SPLUNK_METRICS_INDEX$"
77
iseval = 0

fluent.conf.rt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
hec_token "#{ENV['SPLUNK_METRICS_HEC_TOKEN']}"
2424
flush_interval 5s
2525
source ${tag}
26-
index jfrog_splunk_metrics
26+
index "#{ENV['SPLUNK_METRICS_INDEX']}"
2727
metric_name_key metric_name
2828
metric_value_key value
2929
insecure_ssl "#{ENV['SPLUNK_INSECURE_SSL']}"
@@ -405,7 +405,7 @@
405405
hec_host "#{ENV['SPLUNK_HEC_HOST']}"
406406
hec_port "#{ENV['SPLUNK_HEC_PORT']}"
407407
hec_token "#{ENV['SPLUNK_HEC_TOKEN']}"
408-
index jfrog_splunk
408+
index "#{ENV['SPLUNK_LOGS_INDEX']}"
409409
format json
410410
sourcetype_key log_source
411411
use_fluentd_time false

fluent.conf.xray

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
hec_token "#{ENV['SPLUNK_METRICS_HEC_TOKEN']}"
2424
flush_interval 5s
2525
source ${tag}
26-
index jfrog_splunk_metrics
26+
index "#{ENV['SPLUNK_METRICS_INDEX']}"
2727
metric_name_key metric_name
2828
metric_value_key value
2929
insecure_ssl "#{ENV['SPLUNK_INSECURE_SSL']}"
@@ -156,7 +156,7 @@
156156
hec_host "#{ENV['SPLUNK_HEC_HOST']}"
157157
hec_port "#{ENV['SPLUNK_HEC_PORT']}"
158158
hec_token "#{ENV['SPLUNK_HEC_TOKEN']}"
159-
index jfrog_splunk
159+
index "#{ENV['SPLUNK_LOGS_INDEX']}"
160160
format json
161161
sourcetype_key log_source
162162
use_fluentd_time false
@@ -367,7 +367,7 @@
367367
hec_host "#{ENV['SPLUNK_HEC_HOST']}"
368368
hec_port "#{ENV['SPLUNK_HEC_PORT']}"
369369
hec_token "#{ENV['SPLUNK_HEC_TOKEN']}"
370-
index jfrog_splunk
370+
index "#{ENV['SPLUNK_LOGS_INDEX']}"
371371
format json
372372
sourcetype_key log_source
373373
use_fluentd_time false

fluentd-demo.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
hec_host HEC_HOST
186186
hec_port HEC_PORT
187187
hec_token HEC_TOKEN
188-
index jfrog_splunk
188+
index "#{ENV['SPLUNK_LOGS_INDEX']}"
189189
format json
190190
sourcetype_key log_source
191191
use_fluentd_time false

helm/artifactory-ha-values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ artifactory:
4747
value: {{ .Values.splunk.metrics_token }}
4848
- name: SPLUNK_HEC_TOKEN
4949
value: {{ .Values.splunk.logs_token }}
50+
- name: SPLUNK_LOGS_INDEX
51+
value: {{ .Values.splunk.logs_index | default "jfrog_splunk" }}
52+
- name: SPLUNK_METRICS_INDEX
53+
value: {{ .Values.splunk.metrics_index | default "jfrog_splunk_metrics" }}
5054
- name: SPLUNK_INSECURE_SSL
5155
value: {{ .Values.splunk.insecure_ssl | quote}}
5256
- name: SPLUNK_VERIFY_SSL
@@ -62,6 +66,8 @@ splunk:
6266
port: SPLUNK_HEC_PORT
6367
logs_token: SPLUNK_HEC_TOKEN
6468
metrics_token: SPLUNK_METRICS_HEC_TOKEN
69+
logs_index: SPLUNK_LOGS_INDEX
70+
metrics_index: SPLUNK_METRICS_INDEX
6571
com_protocol: SPLUNK_COM_PROTOCOL
6672
insecure_ssl: SPLUNK_INSECURE_SSL
6773
verify_ssl: SPLUNK_VERIFY_SSL

helm/artifactory-values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ artifactory:
4747
value: {{ .Values.splunk.metrics_token }}
4848
- name: SPLUNK_HEC_TOKEN
4949
value: {{ .Values.splunk.logs_token }}
50+
- name: SPLUNK_LOGS_INDEX
51+
value: {{ .Values.splunk.logs_index | default "jfrog_splunk" }}
52+
- name: SPLUNK_METRICS_INDEX
53+
value: {{ .Values.splunk.metrics_index | default "jfrog_splunk_metrics" }}
5054
- name: SPLUNK_INSECURE_SSL
5155
value: {{ .Values.splunk.insecure_ssl | quote}}
5256
- name: SPLUNK_VERIFY_SSL
@@ -62,6 +66,8 @@ splunk:
6266
port: SPLUNK_HEC_PORT
6367
logs_token: SPLUNK_HEC_TOKEN
6468
metrics_token: SPLUNK_METRICS_HEC_TOKEN
69+
logs_index: SPLUNK_LOGS_INDEX
70+
metrics_index: SPLUNK_METRICS_INDEX
6571
com_protocol: SPLUNK_COM_PROTOCOL
6672
insecure_ssl: SPLUNK_INSECURE_SSL
6773
verify_ssl: SPLUNK_VERIFY_SSL

helm/jfrog_helm.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export SPLUNK_HEC_HOST=splunk.example.com
33
export SPLUNK_HEC_PORT=8088
44
export SPLUNK_HEC_TOKEN=SPLUNK_HEC_TOKEN
55
export SPLUNK_METRICS_HEC_TOKEN=SPLUNK_METRICS_HEC_TOKEN
6+
export SPLUNK_LOGS_INDEX=jfrog_splunk
7+
export SPLUNK_METRICS_INDEX=jfrog_splunk_metrics
68
export SPLUNK_INSECURE_SSL=false
79
export SPLUNK_VERIFY_SSL=true
810
export SPLUNK_COMPRESS_DATA=true

helm/xray-values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ common:
5050
value: {{ .Values.splunk.metrics_token }}
5151
- name: SPLUNK_HEC_TOKEN
5252
value: {{ .Values.splunk.logs_token }}
53+
- name: SPLUNK_LOGS_INDEX
54+
value: {{ .Values.splunk.logs_index | default "jfrog_splunk" }}
55+
- name: SPLUNK_METRICS_INDEX
56+
value: {{ .Values.splunk.metrics_index | default "jfrog_splunk_metrics" }}
5357
- name: SPLUNK_INSECURE_SSL
5458
value: {{ .Values.splunk.insecure_ssl | quote}}
5559
- name: SPLUNK_VERIFY_SSL
@@ -63,6 +67,8 @@ splunk:
6367
port: SPLUNK_HEC_PORT
6468
logs_token: SPLUNK_HEC_TOKEN
6569
metrics_token: SPLUNK_METRICS_HEC_TOKEN
70+
logs_index: SPLUNK_LOGS_INDEX
71+
metrics_index: SPLUNK_METRICS_INDEX
6672
com_protocol: SPLUNK_COM_PROTOCOL
6773
insecure_ssl: SPLUNK_INSECURE_SSL
6874
verify_ssl: SPLUNK_VERIFY_SSL

0 commit comments

Comments
 (0)