Git Product home page Git Product logo

fluent-plugin-typetalk's Introduction

fluent-plugin-typetalk Build Status

Overview

Fluentd plugin to emit notifications to Typetalk.

Requirements

fluent-plugin-typetalk fluentd ruby
>= 0.1.0 >= v0.14.0 >= 2.1
< 0.1.0 >= v0.12.0 >= 1.9

Installation

Install with gem or fluent-gem command as:

# for fluentd
$ gem install fluent-plugin-typetalk

# for td-agent
$ sudo /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-typetalk

Configuration

Usage

This plugin uses client credentials for authentication. See the developer document how to get your own credential.

<match ...>
  @type typetalk
  client_id YOUR_CLIENT_ID
  client_secret YOUR_CLIENT_SECRET
  topic_id YOUR_TOPIC_ID
  message notice: %s [%s] %s errors found
  out_keys tag,time,count
  time_key time
  time_format %Y/%m/%d %H:%M:%S
  tag_key tag
</match>

The notified message will look like this : notice: count.service [2014/05/13 03:34:02] 200 errors found. The meanings of out_keys,time_key,time_format and tag_key are equivalent to those of fluent-plugin-ikachan.

This plugin allows you to use special value namely $hostname in out_keys. By using it, you can include hostname within the notified message.

<match ...>
  @type typetalk
  client_id YOUR_CLIENT_ID
  client_secret YOUR_CLIENT_SECRET
  topic_id YOUR_TOPIC_ID
  message notice: %s [%s] %s errors found on %s
  out_keys tag,time,count,$hostname
  time_key time
  time_format %Y/%m/%d %H:%M:%S
  tag_key tag
</match>

By default, the number of notification you can send within a minute is limited to 10. Log lines that exceed this limit will be discarded. You can change it with interval and limit parameters.

<match ...>
  @type typetalk
  :
  interval 300
  limit 10
</match>

In the example above, you can allow 10 notifications to be sent within 300 seconds. To remove the notification throttle, set both parameters to 0.

Typetalk doesn't allow message which length is equal to or greater than 4000. Since 0.0.5, the message over 4000 characters will be truncated automatically. To turn off this behaviour, set truncate_message to false

<match ...>
  @type typetalk
  :
  truncate_message false
</match>

If you set this value to false, the message over 4000 characters will not be sent to Typetalk.

TODO

Pull requests are very welcome!!

For developers

You have to run the command below when starting development.

$ bundle install --path vendor/bundle

To run tests, do the following.

$ VERBOSE=1 bundle exec rake test

If you want to run a certain file, run rake like this

$ VERBOSE=1 bundle exec rake test TEST=test/plugin/test_out_typetalk.rb

In addition, you can run specific method like this.

$ VERBOSE=1 bundle exec rake test TEST=test/plugin/test_out_typetalk.rb TESTOPTS="--name=test_post_message_invalid_request_error"

When releasing, call rake release as follows.

$ bundle exec rake release

Copyright

  • Copyright (c) 2014- Takashi Someda (@tksmd)
  • Apache License, Version 2.0

fluent-plugin-typetalk's People

Contributors

okkez avatar tsuyoshizawa avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

umakoz matsuzj okkez

fluent-plugin-typetalk's Issues

Could you migrate to Fluentd v0.14 API?

Could you migrate to Fluent d v0.14 API?

Other chat(like) services:

  • fluent-plugin-hipchat: done
  • fluent-plugin-slack: will be merged soon
  • fluent-plugin-twitter: done

And 100+ plugins have already been migrated to Fluentd v0.14 plugin API.

Mention me, please. If you have questions.

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.