Giter VIP home page Giter VIP logo

fluent-bit-out-syslog's Introduction

Fluent Bit Syslog Output Plugin

The Fluent Bit Syslog Output plugin translates kubernetes cluster logs into RFC5424 syslog messages. It uses Cloud Foundry's RFC5424 library.

How to Configure Fluent Bit Conf

Below is a sample fluent bit configuration file. Sinks are also referred to as namespace sinks and forward logs from a particular namespace onto a syslog destination. Whereas, ClusterSinks forward all logs from all namespaces to the specified syslog destination.

The tls configuration is optional and is required only if connecting to an endpoint that supports TLS.

SanitizeHost controls whether the hostname field in outgoing messages is sanitized to match DNS hostname requirements (no characters besides letters, digits and hyphens, no leading or trailing hyphens in each part). It is enabled by default as of the most recent release.

Sample Config File

Syslog output plugin with kubernetes namespace filter

[INPUT]
    Name              tail
    Tag               kube.*
    Path              /var/log/containers/*.log
    Parser            docker
    DB                /var/log/flb_kube.db
    Mem_Buf_Limit     5MB
    Skip_Long_Lines   On
    Refresh_Interval  10

[FILTER]
    Name                kubernetes
    Match               kube.*
    Kube_URL            https://kubernetes.default.svc.cluster.local:443
    Merge_Log           On
    K8S-Logging.Parser  On

[OUTPUT]
    Name          syslog
    InstanceName  insecure-namespace-sink
    Match         *
    Addr          logs.papertrailapp.com:18271
    Namespace     myns
    TLSConfig     {"insecure_skip_verify":true}

[OUTPUT]
    Name          syslog
    InstanceName  plaintext-cluster-sink
    Match         *
    Addr          logs.papertrailapp.com:18271
    Cluster       true
    TLSConfig     {"root_ca":"/path/to/root/ca"}
    SanitizeHost  false

Development

How to Test and Build the plugin:

# get the code
cd workspace
git clone [email protected]:pivotal-cf/fluent-bit-out-syslog.git
cd fluent-bit-out-syslog

# run the linter
./tests/run-linter.sh

# run test
go test -v ./...

# build the plugin
go build -mod vendor -buildmode c-shared -o out_syslog.so cmd/main.go

How To Run In Local laptop

fluent-bit \
    --input dummy \
    --plugin ./out_syslog.so \
    --output syslog \
    --prop InstanceName='testing' \
    --prop Addr='localhost:12345' \
    --prop Cluster='true'

fluent-bit-out-syslog's People

Contributors

bradylove avatar chentom88 avatar dennyzhang avatar dtimm avatar farmermel avatar ginobiliwang avatar oratos-bot avatar pianohacker avatar

Watchers

 avatar  avatar

Forkers

ceesco53 sgusagsd

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.