inputhttp

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: 10 Imported by: 3

README

gogstash input http

Synopsis

{
	"input": [
		{
			"type": "http",

			// (optional), one of ["HEAD", "GET"], default: "GET"
			"method": "GET",

			// (required)
			"url": "",

			// (optional), in seconds, default: 60
			"interval": 60
		}
	]
}

Details

  • type
    • Must be "http"
  • method
    • http request method
  • url
    • http request url
  • interval
    • How often (in seconds) to request a http endpoint.

Documentation

Index

Constants

View Source
const ErrorTag = "gogstash_input_http_error"

ErrorTag tag added to event when process module failed

View Source
const ModuleName = "http"

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
	Method   string `json:"method,omitempty"` // one of ["HEAD", "GET"]
	URL      string `json:"url"`
	Interval int    `json:"interval,omitempty"`
	// contains filtered or unexported fields
}

InputConfig holds the configuration json fields and internal objects

func DefaultInputConfig

func DefaultInputConfig() InputConfig

DefaultInputConfig returns an InputConfig struct with default values

func (*InputConfig) Request

func (t *InputConfig) Request(ctx context.Context, msgChan chan<- logevent.LogEvent)

func (*InputConfig) SendRequest

func (t *InputConfig) SendRequest(ctx context.Context) (data []byte, err error)

func (*InputConfig) Start

func (t *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