Code Monkey home page Code Monkey logo

logstash-output-clickhouse's Introduction

Logstash Plugin

This plugin is a modified version of the Lucidworks logstash json_batch. That plugin is available here.

It has been modified to support ClickHouse JSON Format, but also supports fault tolerance.

Usage

Please note that the name of the plugin when used is clickhouse, it only supports json in its current form. If further output formats are added in the future, this might change back to json_batch.

output {
  clickhouse {
    headers => ["Authorization", "Basic YWRtaW46cGFzc3dvcmQxMjM="]
    http_hosts => ["http://your.clickhouse1/", "http://your.clickhouse2/", "http://your.clickhouse3/"]
    table => "table_name"
    mutations => {
      "to1" => "from1"
      "to2" => [ "from2", "(.)(.)", '\1\2' ]
    }
  }
}

Other custom options

  • save_on_failure (default: true) - enable / disable request body save on failure
  • save_dir (default: /tmp) - directory where failed request body will be saved
  • automatic_retries (default: 1) - number of connect retry attempts to each host in http_hosts
  • request_tolerance (default: 5) - number of http request send retry attempts if response status code is not 200
  • backoff_time (default: 3) - time to wait in seconds for next retry attempt of connect or request

Default batch size is 50, with a wait of at most 5 seconds per send. These can be tweaked with the parameters flush_size and idle_flush_time respectively.

Installation

The easiest way to use this plugin is by installing it through rubygems like any other logstash plugin. To get the latest versio installed, you should run the following command: bin/logstash-plugin install logstash-output-clickhouse

Building the gem and installing a local version

To build the gem yourself, use gem build logstash-output-clickhouse.gemspec in the root of this repository. Alternatively, you can download a built version of the gem from the dist branch of this repository.

To install, run the following command, assuming the gem is in the local directory: $LOGSTASH_HOME/bin/plugin install logstash-output-clickhouse-X.Y.Z.gem

logstash-output-clickhouse's People

Contributors

funcmike avatar akzhan avatar gothug avatar e7su avatar gadost avatar xtrueman avatar

Watchers

James Cloos avatar  avatar

Forkers

ypyunnan

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.