Coder Social home page Coder Social logo

flume-ng-elasticsearch-serializer-num's Introduction

flume-ng-elasticsearch-serializer-num

An elasticsearch flume serializer with awareness for numerical value. This is a quick and dirty hack to support numerical values stored to elasticsearch in order to analyze it with Kibana. Please be aware that this implementation might not perform the very best and only use it with caution :)

Config

In order to attach this serializer to flume the following tasks need to be performed:

  1. mvn clean assembly:assembly
  2. copy the generated jar (*-with-dependencies-*) into the flume lib directory
  3. define the following serializer: ch.creativecode.logging.ElasticsearchNumSerializer (e.g. a1.sinks.k1.serializer = ch.creativecode.logging.ElasticsearchNumSerializer)

EqualsInterceptor

This package includes an EqualsInterceptor to allow extracting header fields from the body with the following syntax: field=value In order to use it the following interceptor has to be defined: ch.creativecode.logging.EqualsInterceptor$Builder. Due to strange reasons, currently the Builder has to be specified instead of the Interceptor implementation.

KibanaTimeStampInterceptor

In order to use Kibana to analyze the data properly one has to deal with the timestamp. This does not come out-of-the-box with the Flume Elasticsearch sink. The KibanaTimeStampInterceptor does the following:

  1. It looks for a header called @timestamp as Long (ms)
  2. It converts the value to the proper ISODateTimeFormat
  3. It stores the milliseconds as timestamp in the header. Apparently the Elasticsearch sink relies on this property.
    Therefore in order to use this interceptor, one has to set the @timestamp header to the event. Using the EqualsInterceptor described above the following pattern can be used in log4j: @timestamp=%d{UNIX_MILLIS} class=%c{1} %msg

flume-ng-elasticsearch-serializer-num's People

Contributors

nicolasbaer avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

ytc301

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.