All Apps and Add-ons

Splunk App for Jenkins: How to pass environment variables to Splunk

jonathan1234
Engager

Hello,

Does anybody know how to populate the "Environment Variables" section (found under the "Build Information" tab on the left) in the Splunk App for Jenkins? It's a scripted pipeline job. The "Build Summary" section (under the same "Build Information" tab) and "Logs and Artifacts" section are both populated.

I've reviewed the documentation on the Splunk Plugin for Jenkins page (https://wiki.jenkins.io/display/JENKINS/Splunk+Plugin+for+Jenkins) and the Splunk Plugin for Pipeline Job Support (https://wiki.jenkins.io/display/JENKINS/Splunk+Plugin+for+Pipeline+Job+Support) page but both are lacking in good documentation.

Thanks

0 Karma

jonathan1234
Engager

Well this is a huge pain. Splunk "can't" help as the app isn't officially supported. We ended up solving this issue by calling the the splunkins.send() method. See the Customize Event Processing Script section in the Splunk Plugin for Jenkins page. It provides a very basic example of how to manually send data to Splunk. There are probably better ways to achieve the same goal.

In our project, the splunkins.send() method is called from a shared library within a Jenkinsfile. The repos to include inside the POM can be found at MVNRepository.com.

0 Karma

jonathan1234
Engager

Links that didn't make it through:

Splunk Plugin for Jenkins - https://wiki.jenkins.io/display/JENKINS/Splunk+Plugin+for+Jenkins
MVNRepository.com - https://mvnrepository.com/artifact/com.splunk.splunkins

0 Karma
Get Updates on the Splunk Community!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...