All Apps and Add-ons

Splunk App for Jenkins: Why is Jenkins log data not being sent to Splunk?

mlkrienke
Explorer

I have an instance of Jenkins and Splunk running on my local machine. I am getting basic information from Jenkins into Splunk but I am not getting the log data to show up as is shown in the sample screen shot of the "console". I did a network trace and don't ever see any calls leaving Jenkins that contain log data (archive command is in the post run section). I am running a simple test that just actually does a couple of messages to the Jenkins console.

I've tried a variety of settings here are my current ones.

host=test3
jenkins_config.enabled=false
sourcetype=_json
source=jenkins

index=jenkins_statistics
build_report.index=jenkins
console_log.index=jenkins_console
file.index=jenkins_artifact
0 Karma
1 Solution

mlkrienke
Explorer

To close this out: the issue is that, at this time, Jenkins Pipeline jobs aren't support by the plugin for console logs. Which is a too bad since that's what we are using, but at least I have an answer and did confirm that an alternate job type like freestyle did work.

View solution in original post

0 Karma

txiao_splunk
Splunk Employee
Splunk Employee

https://wiki.jenkins.io/display/JENKINS/Splunk+Plugin+for+Pipeline+Job+Support

#scripted pipeline
sendSplunkConsoleLog {
  node{
    sh "echo testjob";
 }
}


#declarative pipeline
pipeline {
    agent any
    options {
        timeout(time: 1, unit: 'HOURS')
        sendSplunkConsoleLog()
    }
    stages {
        stage('Example') {
            steps {
                echo 'Hello World'
            }
        }
    }
}
0 Karma

sshahsp
New Member

I am using Splunk plugin 1.7.1 and still getting the same issue. Is it still not supported in 1.7.1 ?

0 Karma

mlkrienke
Explorer

To close this out: the issue is that, at this time, Jenkins Pipeline jobs aren't support by the plugin for console logs. Which is a too bad since that's what we are using, but at least I have an answer and did confirm that an alternate job type like freestyle did work.

0 Karma

txiao_splunk
Splunk Employee
Splunk Employee

Are you using the 1.0 version of the jenkins plugin? If yes, can you try latest version?

0 Karma

mlkrienke
Explorer

I am using 1.3.1.

0 Karma

txiao_splunk
Splunk Employee
Splunk Employee

is the job a pipeline job? right now the plugin does not support capturing pipeline console log

mlkrienke
Explorer

Yes, that was the issue. Tried a freestyle job and it worked. thank you

0 Karma

saireddy1
New Member

Is Jenkins Splunk plugin v1.6.4 works for pipeline jobs? I see the issue still exists.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...