beat

package
v0.0.0-...-a6a716f Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCron         string        = "@every 1m"
	DefaultTimeout      time.Duration = 60 * time.Second
	DefaultDocumentType string        = "httpbeat"
)

Defaults for config variables which are not set

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthenticationConfig

type BasicAuthenticationConfig struct {
	Username string
	Password string
}

type ConfigSettings

type ConfigSettings struct {
	Httpbeat HttpbeatConfig
}

type HttpEvent

type HttpEvent struct {
	ReadTime     time.Time
	DocumentType string
	Fields       map[string]string
	Request      Request
	Response     Response
}

func (*HttpEvent) ToMapStr

func (h *HttpEvent) ToMapStr() common.MapStr

type Httpbeat

type Httpbeat struct {
	HbConfig ConfigSettings
	// contains filtered or unexported fields
}

func New

func New() *Httpbeat

func (*Httpbeat) Cleanup

func (h *Httpbeat) Cleanup(b *beat.Beat) error

func (*Httpbeat) Config

func (h *Httpbeat) Config(b *beat.Beat) error

func (*Httpbeat) Run

func (h *Httpbeat) Run(b *beat.Beat) error

func (*Httpbeat) Setup

func (h *Httpbeat) Setup(b *beat.Beat) error

func (*Httpbeat) Stop

func (h *Httpbeat) Stop()

type HttpbeatConfig

type HttpbeatConfig struct {
	Urls []UrlConfig
}

type Poller

type Poller struct {
	// contains filtered or unexported fields
}

func NewPooler

func NewPooler(httpbeat *Httpbeat, config UrlConfig) *Poller

func (*Poller) GetResponseHeader

func (p *Poller) GetResponseHeader(response gorequest.Response) map[string]string

func (*Poller) Run

func (p *Poller) Run()

func (*Poller) Stop

func (p *Poller) Stop()

type Request

type Request struct {
	Url     string            `json:"url"`
	Method  string            `json:"method"`
	Headers map[string]string `json:"headers,omitempty"`
	Body    string            `json:"body,omitempty"`
}

type Response

type Response struct {
	StatusCode int                    `json:"statusCode"`
	Headers    map[string]string      `json:"headers,omitempty"`
	Body       string                 `json:"body,omitempty"`
	JsonBody   map[string]interface{} `json:"jsonBody,omitempty"`
}

type UrlConfig

type UrlConfig struct {
	Cron         string
	Url          string
	BasicAuth    BasicAuthenticationConfig `yaml:"basic_auth"`
	Method       string
	Body         string
	Headers      map[string]string
	ProxyUrl     string `yaml:"proxy_url"`
	Timeout      *int64
	DocumentType string            `yaml:"document_type"`
	Fields       map[string]string `yaml:"fields"`
	TLS          *outputs.TLSConfig
	JsonDotMode  string `yaml:"json_dot_mode"`
}

Jump to

Keyboard shortcuts

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