Giter VIP home page Giter VIP logo

fluent-bit-sumologic's Introduction

Fluent Bit X Sumo Logic

Output plugin for Fluent Bit which can send logs to Sumo Logic!

Usage

Build the code in this repository as a c-shared object, using the following command:

go build -buildmode=c-shared -o out_sumologic.so main.go

Run Fluent Bit with this new plugin, using the following command:

fluent-bit -e out_sumologic.so -i tail -o sumologic

Refer to the Fluent Bit Docs and this Dockerfile for more hints.

Configuration

This plugin supports the following configuration properties:

Property Required Default Value Tag Substitution Description
Collector_Url Sumo Logic Hosted Collector Endpoint for Logs. For more details refer to - Sumo Logic Docs
Match Used to route data between the input and output plugins in Fluent Bit. For more details refer to - Fluent Bit Docs
Source_Name Unconfigured Specify an override for the Source Name. Defaults to the Collector Source Name configured in Sumo Logic
Source_Host os.Hostname() Specify an override for the Source Host. Defaults to the hostname returned by the kernel
Source_Category sumologic_default Specify the Source Category to send logs to in Sumo Logic
Tag_Delimiter . Used to split the tag sent by the input plugin, helps with the Tag Substitution
Level info Specify the log level for the plugin. Defaults to info
Log_Key log Specify the field to be extracted from the json record, sends the entire record to Sumo Logic otherwise.
Max_Retries 10 Max retries in case of failures when attempting to communicate with Sumo Logic

Tag Substitution

The plugin supports dynamically populating the supported configuration options with values from the tag sent by the input plugin.

Example configuration

[INPUT]
    Name                tail
    Path                /var/log/containers/*.log
    Parser              docker
    Tag                 kube.<namespace_name>.<pod_name>.<container_name>
    Tag_Regex           (?<pod_name>[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<container_name>.+)-

[OUTPUT]
    Name                sumologic
    Match               kube.*
    Collector_Url       url
    Tag_Delimiter       .
    Source_Host         $TAG[1]_$TAG[2]
    Level               info

In the above configuration, the tag is populated with the information about the Kubernetes Namespace, Pod Name, and Container Name by the input plugin.

This tag is then split by the sumologic plugin with the help from the Tag_Delimiter property to create the TagSlice and replaces all the occurrences of $TAG[i] (where i is the index of the element in TagSlice)

So in this case Source_Host would be evalutated as <namespace_name>_<pod_name>, which is very helpful in environments like Kubernetes.

fluent-bit-sumologic's People

Contributors

mittalvaibhav1 avatar

Watchers

 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.