This repository is getting archived and the plugin will be maintained in jenkins repo itself as suggested by Jenkins open source team in this ticket.
Plugin can be installed and used with global configuration. Below are set of features that can be used individually.
Sumologic-publisher
need Pipeline Rest API, GIT, metrics, subversion and junit. If not present, Sumologic-publisher
will install these plugins as a part of internal dependency.In manage plugins
, search for sumologic-publisher
version 2.2.2
and install the plugin.
Tested with Jenkins version 2.361.4
and java version 11. In case of any issue, please raise a issue.
SumoLogic Portal Name - Eg- service.sumologic.com (where hosted collector resides).
Enable proxy settings - Check to enable proxy settings
Proxy Host - Input the proxy server URL. e.g proxy.example.com
Proxy Port - Input the port for the proxy server.
Enable Proxy Authentication - Check to enable authentication for the proxy.
Username - Input the username to use for the proxy.
Password - Input the password to use for the proxy.
Metric Data Prefix - Can be the name of the Jenkins Master on which plugin is installed or name with you can distinguish Jenkins Master.
HTTP Source URL - URL of the HTTP Logs and Metrics Sumo Logic source.
Source Category - Source Category defined for the source provided in the Http Source URL.
Keep Old Configuration for Jobs
Types of Logs
Enable Job Status for All Jobs
Enable Console Logs for All Jobs
In case of specific Jobs
For Freestyle and maven Project
Go To Job Configuration
Sumo Logic Build Logger
For Pipeline Jobs
Go To Job Configuration
In the pipeline configuration, for normal script make below as the top level.
SumoPipelineLogCollection { // your script }
In the pipeline configuration, for declarative pipeline script update the option.
options { SumoPipelineLogCollection() }
Groovy configuration script for Jenkins post-initialisation
The purpose of this script is to automate the global configuration of plugin when Jenkins starts, so that no manual intervention is required via UI afterwards.
This example of Groovy script file should have .groovy
extension and be placed in the directory $JENKINS_HOME/init.groovy.d/.
Download the SumoLogicPublisherConfiguration.groovy file.
The following build environment is required to build the plugin
Java 11
and Maven 3.6.x
.Run mvn clean install
or mvn package
.
Commands will create a sumologic-publisher.hpi
in target folder.
Upload the sumologic-publisher.hpi
in advanced section of manage plugin in Jenkins.
After success building the plugin through mvn clean install
run :
$ export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n"
$ mvn hpi:run
refer : https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial#Plugintutorial-DebuggingaPlugin
The Function can be used in Jenkins Pipelines to send files data to Sumo Logic. Function allow below properties:-
Below are some example uses of the Step Function :-
SumoUpload(file:'file.txt')
SumoUpload(file:'someFolder')
SumoUpload(includePathPattern:'**/*', excludePathPattern:'**/*.log,**/*.json')
Upload file from master directory when Pipeline Stage is running on a agent. Below will send File.txt file present in Archive Folder of the job pipeline on master system.
node('master')
{
SumoUpload(file: "File.txt", workingDir: "$JENKINS_HOME/jobs/$JOB_NAME/builds/$BUILD_NUMBER/archive")
}
Upload a text to Sumo Logic with Fields.
script{
fields = [
jenkins_master: "test_master",
result: currentBuild.currentResult
]
}
SumoUpload(text: "This is test String", fields: fields)
Upload a Key Value map as JSON to Sumo Logic.
script{
deploy_event = [
event_name: STAGE_NAME,
result: currentBuild.currentResult
]
}
SumoUpload(keyValueMap: deploy_event)
For Full Change Log, Visit.
The sumologic-publisher is licensed under the apache v2.0 license.