inputhttp

package
v0.0.0-...-7697303 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2017 License: LGPL-3.0 Imports: 10 Imported by: 0

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) (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(logger *logrus.Logger, msgChan chan<- logevent.LogEvent)

func (*InputConfig) SendRequest

func (t *InputConfig) SendRequest() (data string, 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