Giter VIP home page Giter VIP logo

logstash-output-firebase's Introduction

Logstash Firebase Output Plugin

This is an output plugin for Logstash.

It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.

Documentation

The Firebase output plugin writes data to the Firebase real-time database via the REST API. It is based on the excellent rest-firebase Ruby library by the Codementor folks. Each firebase output allows you to write your event data to whatever reference in your Firebase database.

This output plugin supports all REST operations provided by Firebase, namely:

  • put: to create new data or modify existing data under a specific database reference
  • patch: to update some of the keys under a specific database reference without replacing all of the data.
  • post: to add new data to a list of data
  • delete: to remove data under a specific database reference

The whole event data will be written to Firebase unless the target field is configured, in which case only a subset of the data will be sent to Firebase.

It can be configured very simply as shown below. The event data contained in the data sub-field will be written to the path contained in the event path field using the operation contained in the event verb field.

input {
  stdin { codec => 'json' }
}
output {
  firebase {
    url => 'https://test.firebaseio.com'
    auth => 'secret'
    path => '%{path}'
    verb => '%{verb}'
    target => 'data'
  }
}

Configuration

The following list enumerates all configuration parameters of the firebase output:

  • url: (required) The Firebase URL endpoint
  • secret: (optional) The secret to use for authenticating
  • target: (optional) The target field whose content will be sent to Firebase. If this setting is omitted, the whole event data will be sent. (default)
  • verb: (required) The operation to carry out. Valid operations are put, post, patch, delete or a sprintf style string to specify the operation based on the content of the event (full details here)
  • path: (required) The path to write the event data to. It can also be a sprintf style string to use a path present in the content of the event
  • firebase_timeout: (optional) The number of seconds to wait before the connection times out (default: 10s)
  • firebase_retries: (optional) The number of retries to attempt in case of failures (default: 3)
  • firebase_auth_ttl: (optional) The amount of time to wait before refreshing the authentication token (default: 82800s = 23h) Set to -1 to disable the auto-refresh of the authentication token

Need Help?

Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.

Developing

1. Plugin Developement and Testing

Code

  • To get started, you'll need JRuby with the Bundler gem installed.

  • Create a new plugin or clone and existing from the GitHub logstash-plugins organization. We also provide example plugins.

  • Install dependencies

bundle install

Test

  • Update your dependencies
bundle install
  • Run tests
bundle exec rspec

2. Running your unpublished Plugin in Logstash

2.1 Run in a local Logstash clone

  • Edit Logstash Gemfile and add the local plugin path, for example:
gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
  • Install plugin
bin/logstash-plugin install --no-verify
  • Run Logstash with your plugin
bin/logstash -e 'filter {awesome {}}'

At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.

2.2 Run in an installed Logstash

You can use the same 2.1 method to run your plugin in an installed Logstash by editing its Gemfile and pointing the :path to your local plugin development directory or you can build the gem and install it using:

  • Build your plugin gem
gem build logstash-filter-awesome.gemspec
  • Install the plugin from the Logstash home
bin/logstash-plugin install /your/local/plugin/logstash-filter-awesome.gem
  • Start Logstash and proceed to test the plugin

Contributing

All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.

Programming is not a required skill. Whatever you've seen about open source and maintainers or community members saying "send patches or die" - you will not see that here.

It is more important to the community that you are able to contribute.

For more information about contributing, see the CONTRIBUTING file.

logstash-output-firebase's People

Contributors

consulthys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.