SPLUNK
Versions Supported
This integration is last tested with Artifactory 7.104.7 and Xray 3.88.12 versions.
Table of Contents
Note! You must follow the order of the steps throughout Splunk Configuration
- Splunk Setup
- JFrog Metrics Setup
- FluentD Installation
- Dashboards
- Splunk Demo
- References
Splunk Setup
Splunkbase App
Install the JFrog Log Analytics Platform app from Splunkbase here!
1. Download file from Splunkbase
2. Open Splunk web console as administrator
3. From homepage click on the Manage button with a wheel icon (left side of the screen, in the top right corner of Apps section)
4. Click on "Install app from file"
5. Select download file from Splunkbase on your computer
6. Click upgrade
7. Click upload
Splunk will ask the user to restart to complete the installation. If the app is not restarted automatically, do the following steps:
1. Open Splunk web console as administrator
2. Click on Settings then Server Controls
3. Click on Restart Splunk
Login to Splunk after the restart completes.
Confirm the version is the latest version available in Splunkbase.
Configure Splunk
Our integration uses the Splunk HEC to send data to Splunk.
Users will need to configure the HEC to accept data (enabled) and also create a new token. Steps are below.
Create index for logs (default: jfrog_splunk)
1. Open Splunk web console as administrator
2. Click on "Settings" in dropdown select "Indexes"
3. Click on "New Index"
4. Enter Index name as jfrog_splunk (or your custom name)
5. Click "Save"
Create index for metrics (default: jfrog_splunk_metrics)
1. Open Splunk web console as administrator
2. Click on "Settings" in dropdown select "Indexes"
3. Click on "New Index"
4. Enter Index name as jfrog_splunk_metrics (or your custom name)
5. Select Index Data Type as Metrics
6. Click "Save"
Note: You can customize the index names by setting the SPLUNK_LOGS_INDEX and SPLUNK_METRICS_INDEX environment variables in your docker.env file.
Configure new HEC token to receive Logs
1. Open Splunk web console as administrator
2. Click on "Settings" in dropdown select "Data inputs"
3. Click on "HTTP Event Collector"
4. Click on "New Token"
5. Enter a "Name" in the textbox
6. (Optional) Enter a "Description" in the textbox
7. Click on the green "Next" button
8. Add "jfrog_splunk" (or your custom logs index name) to store the JFrog platform log data into.
9. Click on the green "Review" button
10. If good, Click on the green "Done" button
11. Save the generated token value
Configure new HEC token to receive Metrics
1. Open Splunk web console as administrator
2. Click on "Settings" in dropdown select "Data inputs"
3. Click on "HTTP Event Collector"
4. Click on "New Token"
5. Enter a "Name" in the textbox
6. (Optional) Enter a "Description" in the textbox
7. Click on the green "Next" button
8. Add "jfrog_splunk_metrics" (or your custom metrics index name) to store the JFrog platform metrics data into.
9. Click on the green "Review" button
10. If good, Click on the green "Done" button
11. Save the generated token value
Configure Search Macros
After installing the app and creating your indexes, you need to configure the search macros to use your actual index names.
1. Open Splunk web console as administrator
2. Click on "Settings" โ "Advanced search" โ "Search macros"
3. In the "App" dropdown, select "JFrog Platform Log Analytics, Violations and Metrics" (or "jfrog-logs")
4. Click on "default_index" macro to edit it
5. Change the definition from index="$SPLUNK_LOGS_INDEX$" to index="jfrog_splunk" (or your custom logs index name)
6. Click "Save"
7. Click on "default_metrics_index" macro to edit it
8. Change the definition from "index"="$SPLUNK_METRICS_INDEX$" to "index"="jfrog_splunk_metrics" (or your custom metrics index name)
9. Click "Save"
Note: If you're using environment variables $SPLUNK_LOGS_INDEX$ and $SPLUNK_METRICS_INDEX$ in your deployment, you can skip this step as the macros will automatically use those values.
Important: Without configuring these macros, the dashboards will not display any data even if your indexes contain logs and metrics.
JFrog Metrics Setup
For non Kubernetes-based installations, enable metrics in Artifactory, make the following configuration changes to the Artifactory System YAML
shared:
metrics:
enabled: true
artifactory:
metrics:
enabled: true
Once this configuration is done and the application is restarted, metrics will be available in Open Metrics Format
:bulb: Metrics are enabled by default in Xray.
:bulb: RTFS Metrics: If your Artifactory deployment includes RTFS (JFrog Artifactory Federation Service), metrics are automatically collected from the rtfs/api/v1/metrics endpoint. No additional configuration is required -- the fluentd config already includes an RTFS metrics source block that runs alongside the standard Artifactory metrics collection. Requires fluent-plugin-jfrog-metrics >= 0.2.16.
For Kubernetes-based installations, openMetrics is enabled in the helm install commands listed below
Fluentd Installation
OS / Virtual Machine
Ensure you have access to the Internet from VM. Recommended install is through fluentd's native OS based package installs:
** For Gem based install, Ruby Interpreter has to be setup first, following is the recommended process to install Ruby
1. Install Ruby Version Manager (RVM) as described in https://rvm.io/rvm/install#installation-explained, ensure to follow all the onscreen instructions provided to complete the rvm installation
* For installation across users a SUDO based install is recommended, the installation is as described in https://rvm.io/support/troubleshooting#sudo
2. Once rvm installation is complete, verify the RVM installation executing the command 'rvm -v'
3. Now install ruby v2.7.0 or above executing the command 'rvm install <ver_num>', ex: 'rvm install 2.7.5'
4. Verify the ruby installation, execute 'ruby -v', gem installation 'gem -v' and 'bundler -v' to ensure all the components are intact
5. Post completion of Ruby, Gems installation, the environment is ready to further install new gems, execute the following gem install commands one after other to setup the needed ecosystem
'gem install fluentd'
After FluentD is successfully installed, the below plugins are required to be installed
gem install fluent-plugin-concat
gem install fluent-plugin-splunk-hec
gem install fluent-plugin-jfrog-siem
gem install fluent-plugin-jfrog-metrics
Configure FluentD
We rely heavily on environment variables so that the correct log files are streamed to your observability dashboards. Ensure that you fill in the .env file with correct values. Download the .env file from here
- JF_PRODUCT_DATA_INTERNAL: This environment variable must be set to the folder that contains the
log folder. For each JFrog service, you can find its active log files in the $JFROG_HOME/<product>/var/log. This environment variable should point to the folder that contains the log directory. For example, for artifactory set this variable to $JFROG_HOME/artifactory/var
- SPLUNK_COM_PROTOCOL: HTTP Scheme, http or https
- SPLUNK_HEC_HOST: Splunk Instance URL
- SPLUNK_HEC_PORT: Splunk HEC configured port
- SPLUNK_HEC_TOKEN: Splunk HEC Token for sending logs to Splunk
- SPLUNK_METRICS_HEC_TOKEN: Splunk HEC Token for sending metrics to Splunk
- SPLUNK_LOGS_INDEX: Splunk index name for storing logs (default: jfrog_splunk)
- SPLUNK_METRICS_INDEX: Splunk index name for storing metrics (default: jfrog_splunk_metrics)
- SPLUNK_INSECURE_SSL: false for test environments only or if http scheme
- SPLUNK_VERIFY_SSL: false for disabling ssl validation (useful for proxy forwarding or bypassing ssl certificate validation)
- SPLUNK_COMPRESS_DATA: true for compressing logs and metrics json payloads on outbound to Splunk
- JPD_URL: Artifactory JPD URL of the format
http://<ip_address>
- JPD_ADMIN_USERNAME: Artifactory username for authentication
- JFROG_ADMIN_TOKEN: Artifactory Access Token for authentication
- COMMON_JPD: This flag should be set as true only for non-kubernetes installations or installations where JPD base URL is same to access both Artifactory and Xray (ex: https://sample_base_url/artifactory or https://sample_base_url/xray)
- LOG_ENV: Optional environment tag for categorizing logs and metrics (e.g.,
staging, production, dev). This tag will be added to all logs and metrics sent to Splunk as env:<value>
Apply the .env files and then run the fluentd wrapper with one argument pointed to the fluent.conf.* file configured.
source jfrog.env
./fluentd $JF_PRODUCT_DATA_INTERNAL/fluent.conf.<product_name>
Docker
Note! These steps were not tested to work out of the box on MAC
In order to run FluentD as a docker image to send the logs, violations and metrics data to splunk, the following commands needs to be executed on the host that runs the docker.
Check the docker installation is functional, execute command 'docker version' and 'docker ps'.
Once the version and process are listed successfully, build the intended docker image for Splunk using the docker file,
- Download Dockerfile from here to any directory which has write permissions.
Download the docker.env file needed to run Jfrog/FluentD Docker Images for Splunk,
- Download docker.env from here to the directory where the docker file was downloaded.
For Splunk as the observability platform, execute these commands to setup the docker container running the FluentD installation
Execute
docker build --build-arg SOURCE="JFRT" --build-arg TARGET="SPLUNK" -t <image_name> .
Command example
docker build --build-arg SOURCE="JFRT" --build-arg TARGET="SPLUNK" -t jfrog/fluentd-splunk-rt .
The above command will build the docker image.
Fill the necessary information in the docker.env file