Giter Site home page Giter Site logo

jenkinsci / kafkalogs-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from octanner/kafka-logs-jenkins

3.0 3.0 10.0 33 KB

Jenkins plugin to ship build logs to kafka.

Home Page: https://plugins.jenkins.io/kafkalogs/

License: MIT License

Shell 0.88% Java 86.23% Go 12.90%
kafka logging

kafkalogs-plugin's Introduction

Jenkins Kafka Logs Plugin

This plugin adds support for wrapping pipeline project logs in a build wrapper that ships them to kafka.

This plugin is available here and has a page on the Jenkins Wiki.

Using in pipeline workflows

The build wrapper can be used to ship logs to kafka server and topic.

E.g., pipeline job "test" with build 40 ran with the following pipeline script:

node {
    wrap([$class: 'KafkaBuildWrapper', kafkaServers: 'host1.example.com:9092,host2.example.com:9092', kafkaTopic: 'buildlogs', metadata:'Other info to send..']) {
        echo 'Hello World'
        echo 'Oh Hello'
        echo 'Finally'
    }
}

Or you can use withKafkaLog structs syntax:

node {
	withKafkaLog(kafkaServers: 'host1.example.com:9092,host2.example.com:9092', kafkaTopic: 'buildlogs', metadata:'Other info to send..') {
		echo 'Hello World'
		echo 'Oh Hello'
		echo 'Finally'
	}
}

Would produce messages on kafka topic "buildlogs":

{"build":40,"job":"test","message":"Hello World","metadata":"Other info to send.."}
{"build":40,"job":"test","message":"Oh Hello","metadata":"Other info to send.."}
{"build":40,"job":"test","message":"Finally","metadata":"Other info to send.."}

Copyright and Such

Copyright O.C. Tanner 2018, https://www.octanner.com. See LICENSE for more information.

Work was derived from the sources of https://github.com/jenkinsci/ansicolor-plugin Thanks to Daniel Dobrovkine for providing a great color ansi plugin.

kafkalogs-plugin's People

Contributors

daniel-beck-bot avatar guneetbh avatar trevorlinton avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  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.