SumoLogic / sumologic-jenkins-plugin

Apache License 2.0
11 stars 19 forks source link

SumoLogic ICON

BRANCH ARCHIVED

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.

sumologic-publisher

Build Status Jenkins Plugin GitHub release Jenkins Plugin Installs

Features

Plugin can be installed and used with global configuration. Below are set of features that can be used individually.

  1. SumoUpload - The function provides an ability to upload data from Files directly to Sumo Logic. Data is sent to the HTTP Source URL mentioned in the Global Configuration.

Prerequisite

Installation

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.

Configuration

configuration

Groovy script to configure the Plugin

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.

Developer Version

refer : https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial#Plugintutorial-DebuggingaPlugin

SumoUpload

The Function can be used in Jenkins Pipelines to send files data to Sumo Logic. Function allow below properties:-

  1. file - Provide a file path or a directory path. If the value is a directory then data from all files within the directory will be sent to Sumo Logic.
  2. includePathPattern - Provide a pattern to include file names or extension. For eg:- *.json will include all json files only.
  3. excludePathPattern - Provide a pattern to exclude file names or extension. For eg:- *.json will exclude all json files only.
  4. text - Provide any string that will be sent to Sumo Logic.
  5. keyValueMap - Provide a key value map that will be converted to JSON and sent to Sumo Logic.
  6. workingDir - Provides the path of the directory where files are present. The path will be searched in the node where the Pipeline Step is executed.
  7. fields - Provide a key value map that will be sent as X-Sumo-Fields to Sumo Logic.

Below are some example uses of the Step Function :-

SumoUpload(file:'file.txt')
SumoUpload(file:'someFolder')
SumoUpload(includePathPattern:'**/*', excludePathPattern:'**/*.log,**/*.json')

Change Log

For Full Change Log, Visit.

License

The sumologic-publisher is licensed under the apache v2.0 license.

Contributing