Coder Social home page Coder Social logo

logstash-plugin's Introduction

Jenkins Logstash Plugin

Travis: Build Status Jenkins: Build Status

This plugin adds support for sending a job's console log to Logstash indexers such as ElasticSearch, RabbitMQ, or Redis.

  • see Jenkins wiki for detailed feature descriptions
  • use JIRA to report issues / feature requests

Install

  • Generate the hpi file with the command: mvn package

  • Put the hpi file in the directory $JENKINS_HOME/plugins

  • Restart jenkins

Configure

Currently supported methods of input/output:

  • ElasticSearch {REST API}
  • Redis {format => 'json_event'}
  • RabbitMQ {mechanism => PLAIN}
  • Syslog {format => cee/json (RFC-5424,RFC-3164), protocol => UDP}

Pipeline

Logstash plugin can be used as a publisher in pipeline jobs to send the whole log as a single document.

 node('master') {
        sh'''
        echo 'Hello, world!'
        '''
        logstashSend failBuild: true, maxLines: 1000
 }

It can be used as a wrapper step to send each log line separately.

Note: when you combine with timestamps step, you should make the timestamps the outer most block. Otherwise you get the timestamps as part of the log lines, basically duplicating the timestamp information.

timestamps {
  logstash {
    node('somelabel') {
      sh'''
      echo 'Hello, World!'
      '''
    }
  }
}

License

The Logstash Plugin is licensed under the MIT License.

Contributing

  • Fork the project on Github
  • Make your feature addition or bug fix, write tests, commit.
  • Send me a pull request. Bonus points for topic branches.

Adding support for new indexers

  • Implement the extension point jenkins.plugins.logstash.configuration.LogstashIndexer that will take your configuration. Override the method shouldRefreshInstance() where you decide if a new dao instance must be created because the configuration has changed in the meantime.
  • Create a configure-advanced.jelly for the UI part of your configuration.
  • Create a new class that extends jenkins.plugins.logstash.persistence.AbstractLogstashIndexerDao. This class will do the actual work of pushing the logs to the indexer.

logstash-plugin's People

Contributors

alkuzad avatar bitwiseman avatar diginc avatar hkbao avatar jakub-bochenski avatar mwinter69 avatar r-gerard avatar rebnridgway avatar rwtsoftware avatar sysadmin4j avatar yueyehm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.