splunk / splunkforjenkins

19 stars 55 forks source link

splunk-devops-extend does not send full console output for Pipeline jobs #8

Open snguyen-ith opened 5 years ago

snguyen-ith commented 5 years ago

Given the following Jenkinsfile :

{sendSplunkConsoleLog { node {

        currentBuild.result = "SUCCESS"

        try {

            stage('Checkout'){
                checkout scm
                sh "echo foobar";    
            }

            stage('Test'){

                print "TEST Stage"
            }

            stage('Build'){

                print "BUILD Stage"
            }

            stage('Deploy'){

                print "Deploy Stage"

            }

            stage('Post-Build'){

                print "Cleanup work space and send notifications"

            }

        }
        catch (err) {

            currentBuild.result = "FAILURE"

            print "Notify Build ERROR"

            throw err
        }

    }

}

I'd expect the plugin to forward the full console output to Splunk. But when viewed in Splunk, only the output of the step sh "echo foobar"; is forwarded.

Is this intentional? Is is possible to forward the full console log?

fengxx commented 5 years ago

I believe it sends the logs by default, you can search index=jenkins_console "TEST Stage"