Giter Site home page Giter Site logo

fenxiong / go-config-generator-for-fluentd-and-fluentbit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from awslabs/go-config-generator-for-fluentd-and-fluentbit

0.0 1.0 0.0 11 KB

A Go Library for programmatically generating Fluentd and Fluent Bit Configuration.

License: MIT No Attribution

Makefile 4.51% Go 95.49%

go-config-generator-for-fluentd-and-fluentbit's Introduction

Go Config Generator For Fluentd And Fluentbit

A Go Library for programmatically generating Fluentd and Fluent Bit Configuration.

For example usage, see the unit test file.

The library exports the following interface:

type FluentConfig interface {
	// AddInput adds an input/source directive
	AddInput(name string, tag string, options map[string]string) FluentConfig

	// AddIncludeFilter adds a regex filter that only allows logs which match the regex
	AddIncludeFilter(regex string, key string, tag string) FluentConfig

	// AddExcludeFilter adds a regex filter that only allows logs which do not match the regex
	AddExcludeFilter(regex string, key string, tag string) FluentConfig

	// AddFieldToRecord adds a key value pair to log records
	AddFieldToRecord(key string, value string, tag string) FluentConfig

	// AddExternalConfig adds an @INCLUDE directive to reference an external config file
	AddExternalConfig(filePath string, position IncludePosition) FluentConfig

	// AddOutput adds an output/log destination
	AddOutput(name string, tag string, options map[string]string) FluentConfig

	// WriteFluentdConfig outputs the config in Fluentd syntax
	WriteFluentdConfig(wr io.Writer) error

	// WriteFluentBitConfig outputs the config in Fluent Bit syntax
	WriteFluentBitConfig(wr io.Writer) error
}

The library uses Fluent Bit terminology in the interface; AddInput adds a 'source' in Fluentd syntax, and the name argument is used as the plugin @type.

License Summary

This sample code is made available under the MIT-0 license. See the LICENSE file.

Security disclosures

If you think you’ve found a potential security issue, please do not post it in the Issues. Instead, please follow the instructions here or email AWS security directly at [email protected].

go-config-generator-for-fluentd-and-fluentbit's People

Contributors

jamesiri avatar pettitwesley 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.