beats-sample-plugins

module
v0.0.0-...-53b130a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2017 License: Apache-2.0

README

Some test plugins for use with experimental plugin support in beats with go 1.8 compiler.

Requires at least go1.8 beta2, cgo enabled, and linux.

Go plugins require a go package to build. This project provides the main packages in the ./plugins subdirectory.

Compile plugins via go build -buildmode=plugin ./plugins/<name>

A beats plugin exports all plugins by exporting the global variable var Bundle map[string][]interface{}. Using plugin.Bundle, multiple plugins/bundles can be composed into one common bundle.

Beats PR introducing plugin support: elastic/beats#3217

Plugins:

  • myconsole: re-implements the console plugin. Configure via output.myconsole.pretty: true in config file
  • my_drop_fields: re-implements the drop_fields processor. For testing use my_drop_fields instead of drop_fields
  • lookup: implements lookup.exec from x-exec-lookup branch as plugin.
  • all: all plugin bundles myconsole, my_drop_fields, and lookup into one dynamically loadable plugin.

How to create a plugin

  • The plugins have been generated by copying the original modules/packages from libbeat.
  • remove the package init function, normally registering the package as processor/output plugin
  • export the newXYZ function normally registered as plugin loader
  • create a main package declaring the plugin via processors.Plugin or outputs.Plugin in the global Bundle variable (use of plugin.Bundle is optional).

Directories

Path Synopsis
lookup meta package.
lookup meta package.
plugins
all

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL