Code Monkey home page Code Monkey logo

logstash-output-slack's Introduction

Build Status

Reviews of the code/contributions are very welcome (particularly with testing!), since I don't really know Ruby.

Logstash Slack Output Plugin

Uses Slack incoming webhooks API to send log events to Slack.

Usage:

input {
    ...
}

filters {
    ...
}

output {
    ...
    slack {
        url => <YOUR SLACK WEBHOOK URL HERE>
        channel => [channel-name - optional]
        username => [slack username - optional]
        icon_emoji => [emoji, something like ":simple_smile:" - optional]
        icon_url => [icon url, would be overriden by icon_emoji - optional]
        format => [default is "%{message}", but used to format the text - optional]
        attachments => [an array of attachment maps as specified by the slack API - optional; if there is an "attachments" field in the event map and it is valid, it will override what is configured here, even if it's empty]
    }
}

Changelog:

  • v0.1.4:
    • Drops support for JDK6 (#15)
    • Fix gemspec requirements to support newer versions of logstash core (#14)
  • v0.1.3:
    • No change - bug in releasing
  • v0.1.2:
    • Added support for attachments
  • v0.1.1:
    • Added variable expansion to usernames and channel names (#6)
    • Fixed bug when reporting malformed requests (#3)
    • Test fixes since newer versions of logstash-core expects the values in the add_field hash to not be integers.
  • v0.1.0:
    • initial version containing basic slack functionality

Installation on Logstash >= 1.5

In the logstash directory, run: bin/plugin install logstash-output-slack, which will download and install the public gem.

To build your own gem and install:

  1. git clone <thisrepo>

  2. bundle install

  3. gem build logstash-output-slack.gemspec

  4. cd <path to logstash>

  5. logstash>1.5.0: bin/plugin install <path-to-your-built-gem>

    On logstash==1.5.0, due to this bug, installing from a local gem doesn't work. You will need to:

    1. Make sure that the logstash-core gem you've installed matches the exact beta 1.5 logstash version you are running.
    2. modify the logstash Gemfile to include the line gem "logstash-output-slack", :path => <path_to_the_directory_your_gem_is_in>
    3. bin/plugin install --no-verify

Verify that the plugin installed correctly

bin/plugin list | grep logstash-output-slack

Test that it works:

bin/logstash -e '
input { stdin {} }
output { slack { <your slack config here> }}'

And type some text in. The same text should appear in the channel it's configured to go in.

Installation on Logstash < 1.5

Gem-installing this plugin would only work on Logstash 1.5. For Logstash < 1.5, you could just rename lib in this repo to logstash, and then run Logstash with --pluginpath <path_to_this_repo>.

See the flags documentation for Logstash 1.4.

logstash-output-slack's People

Contributors

cyli avatar joshtgreenwood avatar spang avatar phumpal avatar

Watchers

James Cloos avatar Rok Pergarec 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.