inputhttplisten

package
v0.0.0-...-c13075e Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 11 Imported by: 1

README

gogstash input httplisten

Synopsis

{
	"input": [
		{
			"type": "httplisten",

			// (optional), hostIP:port, default: "localhost:8080"
			"address": "0.0.0.0:8080",

			// (optional), path to accept POST request, default: "/"
			"path": "/mypath/",

			// (optional), Server Certicate File including path, default: ""
			"cert": "/home/user/server.crt"

			// (optional), Server Key File including path. default: "", when both Certicate and Key files provided, HTTP server will start in TLS mode.
			"key": "/home/user/server.key"
		}
	]
}

Details

  • type
    • Must be "httplisten"
  • address
    • http listening IP address and port
  • path
    • http request path to POST request
  • cert
    • Used for https (TLS) mode. Server Certicate File including path
  • key
    • Server Key

Documentation

Index

Constants

View Source
const ModuleName = "httplisten"

ModuleName is the name used in config file

Variables

This section is empty.

Functions

func InitHandler

func InitHandler(
	ctx context.Context,
	raw config.ConfigRaw,
	control config.Control,
) (config.TypeInputConfig, error)

InitHandler initialize the input plugin

Types

type InputConfig

type InputConfig struct {
	config.InputConfig
	Address       string   `json:"address"` // host:port to listen on
	Path          string   `json:"path"`    // The path to accept json HTTP POST requests on
	ServerCert    string   `json:"cert"`
	ServerKey     string   `json:"key"`
	CA            string   `json:"ca"`             // for client certification
	RequireHeader []string `json:"require_header"` // Require this header to be present to accept the POST ("X-Access-Token: Potato")
}

InputConfig holds the configuration json fields and internal objects

func DefaultInputConfig

func DefaultInputConfig() InputConfig

DefaultInputConfig returns an InputConfig struct with default values

func (*InputConfig) Start

func (i *InputConfig) Start(ctx context.Context, msgChan chan<- logevent.LogEvent) (err error)

Start wraps the actual function starting the plugin

Jump to

Keyboard shortcuts

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