All Apps and Add-ons
Highlighted

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

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
Highlighted

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

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
Highlighted

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

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
Speak Up for Splunk Careers!

We want to better understand the impact Splunk experience and expertise has has on individuals' careers, and help highlight the growing demand for Splunk skills.