inputexec

package
v0.0.0-...-3e9a38d Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2016 License: LGPL-3.0 Imports: 13 Imported by: 0

README

gogstash input exec

Synopsis

{
	"input": [
		{
			"type": "exec",

			// (required)
			"command": "",

			// (optional), default: []
			"args": [""],

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

Details

  • type
    • Must be "exec"
  • command
    • Command to run. For example, “uptime”
  • args
    • String array
    • Arguments of command
  • interval
    • Interval to run the command. Value is in seconds.

Documentation

Index

Constants

View Source
const (
	ModuleName = "exec"
)

Variables

This section is empty.

Functions

func InitHandler

func InitHandler(confraw *config.ConfigRaw) (retconf config.TypeInputConfig, err error)

func IsMsgType

func IsMsgType(s string) bool

Types

type InputConfig

type InputConfig struct {
	config.InputConfig
	Command   string   `json:"command"`                  // Command to run. e.g. “uptime”
	Args      []string `json:"args,omitempty"`           // Arguments of command
	Interval  int      `json:"interval,omitempty"`       // Second, default: 60
	MsgTrim   string   `json:"message_trim,omitempty"`   // default: " \t\r\n"
	MsgPrefix string   `json:"message_prefix,omitempty"` // only in text type, e.g. "%{@timestamp} [uptime] "
	MsgType   MsgType  `json:"message_type,omitempty"`   // default: "text"
	// contains filtered or unexported fields
}

func DefaultInputConfig

func DefaultInputConfig() InputConfig

func (*InputConfig) Exec

func (self *InputConfig) Exec(inchan config.InChan, logger *logrus.Logger)

func (*InputConfig) Start

func (self *InputConfig) Start()

type MsgType

type MsgType int8
const (
	MsgTypeText MsgType = 1 + iota
	MsgTypeJson
)

func ParseMsgType

func ParseMsgType(s string) MsgType

func (MsgType) MarshalJSON

func (t MsgType) MarshalJSON() ([]byte, error)

func (*MsgType) Scan

func (t *MsgType) Scan(value interface{}) (err error)

func (MsgType) String

func (t MsgType) String() string

func (*MsgType) UnmarshalJSON

func (t *MsgType) UnmarshalJSON(b []byte) (err error)

func (MsgType) Value

func (t MsgType) Value() (v driver.Value, err error)

Jump to

Keyboard shortcuts

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