graylog

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2018 License: MIT Imports: 8 Imported by: 0

README

go-graylog

GoDoc CircleCI codecov Go Report Card GitHub last commit GitHub tag License

Graylog API client and mock server for Golang and terraform provider for Graylog.

Supported APIs

Graylog provides very various APIs so we can't support all of them yet. Please check the following godoc's Client methods.

https://godoc.org/github.com/suzuki-shunsuke/go-graylog/client

Example - client and mock server

Mock Server CLI tool

Download a binary from the release page.

$ graylog-mock-server --help
graylog-mock-server - Run Graylog mock server.

USAGE:
   graylog-mock-server [options]

VERSION:
   0.1.0

OPTIONS:
   --port value       port number. If you don't set this option, a free port is assigned and the assigned port number is outputed to the console when the mock server runs.
   --log-level value  the log level of logrus which the mock server uses internally. (default: "info")
   --data value       data file path. When the server runs data of the file is loaded and when data of the server is changed data is saved at the file. If this option is not set, no data is loaded and saved.
   --help, -h         show help
   --version, -v      print the version

Terraform provider

Supported Graylog version

We use the graylog's official Docker Image for development.

The version is 2.4.6-1 .

Contribution

See CONTRIBUTING.md .

See also

License

MIT

Documentation

Overview

Package graylog provides Golang's structs which represents Graylog resource such as roles and users. Client and mock server and terraform provider are provided as subpackages.

https://godoc.org/github.com/suzuki-shunsuke/go-graylog/#pkg-subdirectories

Index

Constants

View Source
const (
	// MessageCountRotationStrategy is one of index set's rotation strategies.
	MessageCountRotationStrategy string = "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategy"
	// SizeBasedRotationStrategy is one of index set's rotation strategies.
	SizeBasedRotationStrategy string = "org.graylog2.indexer.rotation.strategies.SizeBasedRotationStrategy"
	// TimeBasedRotationStrategy is one of index set's rotation strategies.
	TimeBasedRotationStrategy string = "org.graylog2.indexer.rotation.strategies.TimeBasedRotationStrategy"
	// MessageCountRotationStrategyConfig is one of index set's rotation strategy configs.
	MessageCountRotationStrategyConfig string = "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyConfig"
	// SizeBasedRotationStrategyConfig is one of index set's rotation strategy configs.
	SizeBasedRotationStrategyConfig string = "org.graylog2.indexer.rotation.strategies.SizeBasedRotationStrategyConfig"
	// TimeBasedRotationStrategyConfig is one of index set's rotation strategy configs.
	TimeBasedRotationStrategyConfig string = "org.graylog2.indexer.rotation.strategies.TimeBasedRotationStrategyConfig"
	// DeletionRetentionStrategy is one of index set's retention strategies.
	DeletionRetentionStrategy string = "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategy"
	// ClosingRetentionStrategy is one of index set's retention strategies.
	ClosingRetentionStrategy string = "org.graylog2.indexer.retention.strategies.ClosingRetentionStrategy"
	// NoopRetentionStrategy is one of index set's retention strategies.
	NoopRetentionStrategy string = "org.graylog2.indexer.retention.strategies.NoopRetentionStrategy"
	// DeletionRetentionStrategyConfig is one of index set's retention strategy configs.
	DeletionRetentionStrategyConfig string = "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfig"
	// ClosingRetentionStrategyConfig is one of index set's retention strategy configs.
	ClosingRetentionStrategyConfig string = "org.graylog2.indexer.retention.strategies.ClosingRetentionStrategyConfig"
	// NoopRetentionStrategyConfig is one of index set's retention strategy configs.
	NoopRetentionStrategyConfig string = "org.graylog2.indexer.retention.strategies.NoopRetentionStrategyConfig"
	// CreationDateFormat is the date format used at graylog API's request and response body.
	CreationDateFormat string = "2006-01-02T15:04:05.000Z"
)
View Source
const (
	// InputTypeAWSCloudTrail is one of input types.
	InputTypeAWSCloudTrail string = "org.graylog.aws.inputs.cloudtrail.CloudTrailInput"
)
View Source
const (
	// InputTypeAWSCloudWatchLogs is one of input types.
	InputTypeAWSCloudWatchLogs string = "org.graylog.aws.inputs.cloudwatch.CloudWatchLogsInput"
)
View Source
const (
	// InputTypeAWSFlowLogs is one of input types.
	InputTypeAWSFlowLogs string = "org.graylog.aws.inputs.flowlogs.FlowLogsInput"
)
View Source
const (
	// InputTypeBeats is one of input types.
	InputTypeBeats string = "org.graylog.plugins.beats.BeatsInput"
)
View Source
const (
	// InputTypeCEFAMQP is one of input types.
	InputTypeCEFAMQP string = "org.graylog.plugins.cef.input.CEFAmqpInput"
)
View Source
const (
	// InputTypeCEFKafka is one of input types.
	InputTypeCEFKafka string = "org.graylog.plugins.cef.input.CEFKafkaInput"
)
View Source
const (
	// InputTypeCEFTCP is one of input types.
	InputTypeCEFTCP string = "org.graylog.plugins.cef.input.CEFTCPInput"
)
View Source
const (
	// InputTypeCEFUDP is one of input types.
	InputTypeCEFUDP string = "org.graylog.plugins.cef.input.CEFUDPInput"
)
View Source
const (
	// InputTypeFakeHTTPMessage is one of input types.
	InputTypeFakeHTTPMessage string = "org.graylog2.inputs.random.FakeHttpMessageInput"
)
View Source
const (
	// InputTypeGELFAMQP is one of input types.
	InputTypeGELFAMQP string = "org.graylog2.inputs.gelf.amqp.GELFAMQPInput"
)
View Source
const (
	// InputTypeGELFHTTP is one of input types.
	InputTypeGELFHTTP string = "org.graylog2.inputs.gelf.http.GELFHttpInput"
)
View Source
const (
	// InputTypeGELFKafka is one of input types.
	InputTypeGELFKafka string = "org.graylog2.inputs.gelf.kafka.GELFKafkaInput"
)
View Source
const (
	// InputTypeGELFTCP is one of input types.
	InputTypeGELFTCP string = "org.graylog2.inputs.gelf.tcp.GELFTCPInput"
)
View Source
const (
	// InputTypeGELFUDP is one of input types.
	InputTypeGELFUDP string = "org.graylog2.inputs.gelf.udp.GELFUDPInput"
)
View Source
const (
	// InputTypeJSONPath is one of input types.
	InputTypeJSONPath string = "org.graylog2.inputs.misc.jsonpath.JsonPathInput"
)
View Source
const (
	// InputTypeNetFlowUDP is one of input types.
	InputTypeNetFlowUDP string = "org.graylog.plugins.netflow.inputs.NetFlowUdpInput"
)
View Source
const (
	// InputTypeRawAMQP is one of input types.
	InputTypeRawAMQP string = "org.graylog2.inputs.raw.amqp.RawAMQPInput"
)
View Source
const (
	// InputTypeSyslogAMQP is one of input types.
	InputTypeSyslogAMQP string = "org.graylog2.inputs.syslog.amqp.SyslogAMQPInput"
)
View Source
const (
	// InputTypeSyslogKafka is one of input types.
	InputTypeSyslogKafka string = "org.graylog2.inputs.syslog.kafka.SyslogKafkaInput"
)
View Source
const (
	// InputTypeSyslogTCP is one of input types.
	InputTypeSyslogTCP string = "org.graylog2.inputs.syslog.tcp.SyslogTCPInput"
)
View Source
const (
	// InputTypeSyslogUDP is one of input types.
	InputTypeSyslogUDP string = "org.graylog2.inputs.syslog.udp.SyslogUDPInput"
)

Variables

View Source
var (
	// InputAttrsIntFieldSet is the set of int fields of all type of input attributes.
	InputAttrsIntFieldSet = set.NewStrSet()
	// InputAttrsBoolFieldSet is the set of bool fields of all type of input attributes.
	InputAttrsBoolFieldSet = set.NewStrSet()
	// InputAttrsStrFieldSet is the set of string fields of all type of input attributes.
	InputAttrsStrFieldSet = set.NewStrSet()
)

Functions

func SetFuncGetInputAttrsByType

func SetFuncGetInputAttrsByType(f GetInputAttrsByTypeIntf)

SetFuncGetInputAttrsByType customizes NewInputAttrsByType's behavior.

func SetFuncGetUnknownTypeInputAttrs

func SetFuncGetUnknownTypeInputAttrs(f GetUnknownTypeInputAttrsIntf)

SetFuncGetUnknownTypeInputAttrs customizes NewInputAttrsByType's behavior.

func SetInputAttrs

func SetInputAttrs(args ...NewInputAttrs) error

SetInputAttrs sets InputAttrs. You can add the custom InputAttrs and override existing InputAttrs.

Types

type AlarmCallback added in v0.5.0

type AlarmCallback struct {
	// ex. "org.graylog2.alarmcallbacks.HTTPAlarmCallback"
	ID            string `json:"id"`
	CreatorUserID string `json:"creator_user_id"`
	CreatedAt     string `json:"created_at"`
	Title         string `json:"title"`
}

AlarmCallback represents an Alarm Callback. http://docs.graylog.org/en/latest/pages/streams/alerts.html#alert-notifications-types-explained

type AlarmCallbacksBody added in v0.5.0

type AlarmCallbacksBody struct {
	AlarmCallbacks []AlarmCallback `json:"alarmcallbacks"`
	Total          int             `json:"total"`
}

AlarmCallbacksBody represents Get Alarm Callbacks API's response body. Basically users don't use this struct, but this struct is public because some sub packages use this struct.

type Alert added in v0.2.0

type Alert struct {
	ID                  string                    `json:"id"`
	Description         string                    `json:"description"`
	ConditionID         string                    `json:"condition_id"`
	StreamID            string                    `json:"stream_id"`
	TriggeredAt         string                    `json:"triggered_at"`
	ResolvedAt          string                    `json:"resolved_at"`
	IsInterval          bool                      `json:"is_interval"`
	ConditionParameters *AlertConditionParameters `json:"condition_parameters"`
}

Alert represents an Alert. http://docs.graylog.org/en/2.4/pages/streams/alerts.html

type AlertCondition

type AlertCondition struct {
	Type          string                    `json:"type"`
	ID            string                    `json:"id"`
	CreatorUserID string                    `json:"creator_user_id"`
	CreatedAt     string                    `json:"created_at"`
	Title         string                    `json:"title"`
	InGrace       bool                      `json:"in_grace"`
	Parameters    *AlertConditionParameters `json:"parameters"`
}

AlertCondition represents an Alert Condition. http://docs.graylog.org/en/2.4/pages/streams/alerts.html#conditions

type AlertConditionParameters added in v0.2.0

type AlertConditionParameters struct {
	Grace               int    `json:"grace"`
	Backlog             int    `json:"backlog"`
	RepeatNotifications bool   `json:"repeat_notifications"`
	Field               string `json:"field"`
	Value               string `json:"value"`
}

AlertConditionParameters represents Alert Condition's parameters.

type AlertConditionsBody added in v0.2.0

type AlertConditionsBody struct {
	AlertConditions []AlertCondition `json:"conditions"`
	Total           int              `json:"total"`
}

AlertConditionsBody represents Get Alert Conditions API's response body. Basically users don't use this struct, but this struct is public because some sub packages use this struct.

type AlertReceivers

type AlertReceivers struct {
	Emails []string `json:"emails,omitempty"`
	Users  []string `json:"users,omitempty"`
}

AlertReceivers represents alert receivers.

type AlertsBody added in v0.2.0

type AlertsBody struct {
	Alerts []Alert `json:"alerts"`
	Total  int     `json:"total"`
}

AlertsBody represents Get Alerts API's response body. Basically users don't use this struct, but this struct is public because some sub packages use this struct.

type Dashboard added in v0.4.0

type Dashboard struct {
	// required
	Title       string `json:"title,omitempty" v-create:"required"`
	Description string `json:"description,omitempty"`

	// ex. "2018-02-20T11:37:19.305Z"
	CreatedAt string `json:"created_at,omitempty"`
	ID        string `json:"id,omitempty" v-create:"isdefault"`
	// TODO support positions
	Widgets []Widget `json:"widgets,omitempty"`
}

Dashboard represents a Graylog's Dashboard. http://docs.graylog.org/en/latest/pages/dashboards.html

type DashboardsBody added in v0.4.0

type DashboardsBody struct {
	Dashboards []Dashboard `json:"dashboards"`
	Total      int         `json:"total"`
}

DashboardsBody represents Get Dashboards API's response body. Basically users don't use this struct, but this struct is public because some sub packages use this struct.

type EmailAlarmCallbackConfiguration added in v0.5.0

type EmailAlarmCallbackConfiguration struct {
	Body    string `json:"body"`
	Sender  string `json:"sender"`
	Subject string `json:"subject"`
}

EmailAlarmCallbackConfiguration represents a configuration of EmailAlarmCallback.

type GetInputAttrsByTypeIntf

type GetInputAttrsByTypeIntf func(map[string]NewInputAttrs, string) InputAttrs

GetInputAttrsByTypeIntf returns a given type InputAttrs.

func GetFuncGetInputAttrsByType

func GetFuncGetInputAttrsByType() GetInputAttrsByTypeIntf

GetFuncGetInputAttrsByType returns the global GetInputAttrsByType function. Mainly this is used to prevent global pollution at test.

f := graylog.GetFuncGetInputAttrsByType()
// change the global function temporary
defer graylog.SetFuncGetInputAttrsByType(f)
graylog.SetFuncGetInputAttrsByType(customFunc)

type GetUnknownTypeInputAttrsIntf

type GetUnknownTypeInputAttrsIntf func(map[string]NewInputAttrs, string) InputAttrs

GetUnknownTypeInputAttrsIntf returns an unknown type InputAttrs.

func GetFuncGetUnknownTypeInputAttrs

func GetFuncGetUnknownTypeInputAttrs() GetUnknownTypeInputAttrsIntf

GetFuncGetUnknownTypeInputAttrs returns the global GetUnknownTypeInputAttrs function. Mainly this is used to prevent global pollution at test.

f := graylog.GetFuncGetUnknownTypeInputAttrs()
// change the global function temporary
defer graylog.SetFuncGetUnknownTypeInputAttrs(f)
graylog.SetFuncGetUnknownTypeInputAttrs(customFunc)

type HTTPAlarmCallbackConfiguration added in v0.5.0

type HTTPAlarmCallbackConfiguration struct {
	URL string `json:"url"`
}

HTTPAlarmCallbackConfiguration represents a configuration of HTTPAlarmCallback.

type IndexSet

type IndexSet struct {
	// required
	Title string `json:"title,omitempty" v-create:"required"`
	// ^[a-z0-9][a-z0-9_+-]*$
	IndexPrefix string `json:"index_prefix,omitempty" v-create:"required,indexprefixregexp"`
	// ex. "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategy"
	RotationStrategyClass string            `json:"rotation_strategy_class,omitempty" v-create:"required"`
	RotationStrategy      *RotationStrategy `json:"rotation_strategy,omitempty" v-create:"required"`
	// ex. "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategy"
	RetentionStrategyClass string             `json:"retention_strategy_class,omitempty" v-create:"required"`
	RetentionStrategy      *RetentionStrategy `json:"retention_strategy,omitempty" v-create:"required"`
	// ex. "2018-02-20T11:37:19.305Z"
	CreationDate                    string `json:"creation_date,omitempty"`
	IndexAnalyzer                   string `json:"index_analyzer,omitempty" v-create:"required"`
	Shards                          int    `json:"shards,omitempty" v-create:"required"`
	IndexOptimizationMaxNumSegments int    `json:"index_optimization_max_num_segments,omitempty" v-create:"required"`

	ID string `json:"id,omitempty" v-create:"isdefault"`

	Description               string         `json:"description,omitempty"`
	Replicas                  int            `json:"replicas,omitempty"`
	IndexOptimizationDisabled bool           `json:"index_optimization_disabled,omitempty"`
	Writable                  bool           `json:"writable,omitempty"`
	Default                   bool           `json:"default,omitempty"`
	Stats                     *IndexSetStats `json:"-"`
}

IndexSet represents a Graylog's Index Set. http://docs.graylog.org/en/2.4/pages/configuration/index_model.html#index-set-configuration

func (*IndexSet) CreationTime

func (is *IndexSet) CreationTime() (time.Time, error)

CreationTime returns a creation date converted to time.Time.

func (*IndexSet) NewUpdateParams

func (is *IndexSet) NewUpdateParams() *IndexSetUpdateParams

NewUpdateParams converts an IndexSet to IndexSetUpdateParams.

func (*IndexSet) SetCreateDefaultValues

func (is *IndexSet) SetCreateDefaultValues()

SetCreateDefaultValues sets the default values of Create Index Set API.

func (*IndexSet) SetCreationTime

func (is *IndexSet) SetCreationTime(t time.Time)

SetCreationTime sets a creation date with time.Time.

type IndexSetStats

type IndexSetStats struct {
	Indices   int `json:"indices"`
	Documents int `json:"documents"`
	Size      int `json:"size"`
}

IndexSetStats represents a Graylog's Index Set Stats.

type IndexSetUpdateParams

type IndexSetUpdateParams struct {
	Title                           string             `json:"title" v-update:"required"`
	IndexPrefix                     string             `json:"index_prefix" v-update:"required,indexprefixregexp"`
	RotationStrategyClass           string             `json:"rotation_strategy_class" v-update:"required"`
	RotationStrategy                *RotationStrategy  `json:"rotation_strategy" v-update:"required"`
	RetentionStrategyClass          string             `json:"retention_strategy_class" v-update:"required"`
	RetentionStrategy               *RetentionStrategy `json:"retention_strategy" v-update:"required"`
	IndexAnalyzer                   string             `json:"index_analyzer" v-update:"required"`
	Shards                          int                `json:"shards" v-update:"required"`
	IndexOptimizationMaxNumSegments int                `json:"index_optimization_max_num_segments" v-update:"required"`
	ID                              string             `json:"id" v-update:"required,objectid"`

	Description               *string `json:"description,omitempty"`
	Replicas                  *int    `json:"replicas,omitempty"`
	IndexOptimizationDisabled *bool   `json:"index_optimization_disabled,omitempty"`
	Writable                  *bool   `json:"writable,omitempty"`
}

IndexSetUpdateParams represents a Graylog's Index Set Update API's parameter. http://docs.graylog.org/en/2.4/pages/configuration/index_model.html#index-set-configuration

type IndexSetsBody

type IndexSetsBody struct {
	IndexSets []IndexSet               `json:"index_sets"`
	Stats     map[string]IndexSetStats `json:"stats"`
	Total     int                      `json:"total"`
}

IndexSetsBody represents Get Index Sets API's response body. Basically users don't use this struct, but this struct is public because some sub packages use this struct.

type Input

type Input struct {
	// Select a name of your new input that describes it.
	Title string `json:"title,omitempty" v-create:"required"`
	// https://github.com/Graylog2/graylog2-server/issues/3480
	// update input overwrite attributes
	Attrs InputAttrs `json:"attributes,omitempty" v-create:"required"`

	ID string `json:"id,omitempty" v-create:"isdefault"`

	// Should this input start on all nodes
	Global bool `json:"global,omitempty"`
	// On which node should this input start
	// ex. "2ad6b340-3e5f-4a96-ae81-040cfb8b6024"
	Node string `json:"node,omitempty"`
	// ex. 2018-02-24T03:02:26.001Z
	CreatedAt string `json:"created_at,omitempty" v-create:"isdefault"`
	// ex. "admin"
	CreatorUserID string `json:"creator_user_id,omitempty" v-create:"isdefault"`
}

Input represents Graylog Input.

func (*Input) MarshalJSON

func (input *Input) MarshalJSON() ([]byte, error)

MarshalJSON is the implementation of the json.Marshaler interface.

func (*Input) NewUpdateParams

func (input *Input) NewUpdateParams() *InputUpdateParams

NewUpdateParams converts Input to InputUpdateParams.

func (*Input) ToData

func (input *Input) ToData() (*InputData, error)

ToData assigns input's data to InputData.

func (Input) Type

func (input Input) Type() string

Type returns the input's type.

func (*Input) UnmarshalJSON

func (input *Input) UnmarshalJSON(b []byte) error

UnmarshalJSON is the implementation of the json.Unmarshaler interface.

type InputAWSCloudTrailAttrs

type InputAWSCloudTrailAttrs struct {
	CreatorUserID     string `json:"creator_user_id,omitempty" v-create:"isdefault"`
	AWSAssumeRoleArn  string `json:"aws_assume_role_arn,omitempty"`
	AWSAccessKey      string `json:"aws_access_key,omitempty"`
	AWSSecretKey      string `json:"aws_secret_key,omitempty"`
	AWSSQSRegion      string `json:"aws_sqs_region,omitempty"`
	AWSSQSQueueName   string `json:"aws_sqs_queue_name,omitempty"`
	AWSS3Region       string `json:"aws_s3_region,omitempty"`
	ThrottlingAllowed bool   `json:"throttling_allowed,omitempty"`
	OverrideSource    string `json:"override_source,omitempty"`
}

InputAWSCloudTrailAttrs represents aws cloud trail Input's attributes.

func (InputAWSCloudTrailAttrs) InputType

func (attrs InputAWSCloudTrailAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputAWSCloudWatchLogsAttrs

type InputAWSCloudWatchLogsAttrs struct {
	AWSRegion         string `json:"aws_region,omitempty"`
	AWSAssumeRoleArn  string `json:"aws_assume_role_arn,omitempty"`
	AWSAccessKey      string `json:"aws_access_key,omitempty"`
	AWSSecretKey      string `json:"aws_secret_key,omitempty"`
	KinesisStreamName string `json:"kinesis_stream_name,omitempty"`
	ThrottlingAllowed bool   `json:"throttling_allowed,omitempty"`
	OverrideSource    string `json:"override_source,omitempty"`
}

InputAWSCloudWatchLogsAttrs represents AWS logs Input's attributes.

func (InputAWSCloudWatchLogsAttrs) InputType

func (attrs InputAWSCloudWatchLogsAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputAWSFlowLogsAttrs

type InputAWSFlowLogsAttrs struct {
	AWSRegion         string `json:"aws_region,omitempty"`
	AWSAssumeRoleArn  string `json:"aws_assume_role_arn,omitempty"`
	AWSAccessKey      string `json:"aws_access_key,omitempty"`
	AWSSecretKey      string `json:"aws_secret_key,omitempty"`
	KinesisStreamName string `json:"kinesis_stream_name,omitempty"`
	ThrottlingAllowed bool   `json:"throttling_allowed,omitempty"`
}

InputAWSFlowLogsAttrs represents AWS flow logs Input's attributes.

func (InputAWSFlowLogsAttrs) InputType

func (attrs InputAWSFlowLogsAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputAttrs

type InputAttrs interface {
	InputType() string
}

InputAttrs represents Input Attributes. A receiver must be a pointer.

func NewInputAWSCloudTrailAttrs

func NewInputAWSCloudTrailAttrs() InputAttrs

NewInputAWSCloudTrailAttrs is the constructor of InputAWSCloudTrailAttrs.

func NewInputAWSCloudWatchLogsAttrs

func NewInputAWSCloudWatchLogsAttrs() InputAttrs

NewInputAWSCloudWatchLogsAttrs is the constructor of InputAWSCloudWatchLogsAttrs.

func NewInputAWSFlowLogsAttrs

func NewInputAWSFlowLogsAttrs() InputAttrs

NewInputAWSFlowLogsAttrs is the constructor of InputAWSFlowLogsAttrs.

func NewInputAttrsByType

func NewInputAttrsByType(t string) InputAttrs

NewInputAttrsByType returns a new InputAttrs.

func NewInputBeatsAttrs

func NewInputBeatsAttrs() InputAttrs

NewInputBeatsAttrs is the constructor of InputBeatsAttrs.

func NewInputCEFAMQPAttrs

func NewInputCEFAMQPAttrs() InputAttrs

NewInputCEFAMQPAttrs is the constructor of InputCEFAMQPAttrs.

func NewInputCEFKafkaAttrs

func NewInputCEFKafkaAttrs() InputAttrs

NewInputCEFKafkaAttrs is the constructor of InputCEFKafkaAttrs.

func NewInputCEFTCPAttrs

func NewInputCEFTCPAttrs() InputAttrs

NewInputCEFTCPAttrs is the constructor of InputCEFTCPAttrs.

func NewInputCEFUDPAttrs

func NewInputCEFUDPAttrs() InputAttrs

NewInputCEFUDPAttrs is the constructor of InputCEFUDPAttrs.

func NewInputFakeHTTPMessageAttrs

func NewInputFakeHTTPMessageAttrs() InputAttrs

NewInputFakeHTTPMessageAttrs is the constructor of InputFakeHTTPMessageAttrs.

func NewInputGELFAMQPAttrs

func NewInputGELFAMQPAttrs() InputAttrs

NewInputGELFAMQPAttrs is the constructor of InputGELFAMQPAttrs.

func NewInputGELFHTTPAttrs

func NewInputGELFHTTPAttrs() InputAttrs

NewInputGELFHTTPAttrs is the constructor of InputGELFHTTPAttrs.

func NewInputGELFKafkaAttrs

func NewInputGELFKafkaAttrs() InputAttrs

NewInputGELFKafkaAttrs is the constructor of InputGELFKafkaAttrs.

func NewInputGELFTCPAttrs

func NewInputGELFTCPAttrs() InputAttrs

NewInputGELFTCPAttrs is the constructor of InputGELFTCPAttrs.

func NewInputGELFUDPAttrs

func NewInputGELFUDPAttrs() InputAttrs

NewInputGELFUDPAttrs is the constructor of InputGELFUDPAttrs.

func NewInputJSONPathAttrs

func NewInputJSONPathAttrs() InputAttrs

NewInputJSONPathAttrs is the constructor of InputJSONPathAttrs.

func NewInputNetFlowUDPAttrs

func NewInputNetFlowUDPAttrs() InputAttrs

NewInputNetFlowUDPAttrs is the constructor of InputNetFlowUDPAttrs.

func NewInputRawAMQPAttrs

func NewInputRawAMQPAttrs() InputAttrs

NewInputRawAMQPAttrs is the constructor of InputRawAMQPAttrs.

func NewInputSyslogAMQPAttrs

func NewInputSyslogAMQPAttrs() InputAttrs

NewInputSyslogAMQPAttrs is the constructor of InputSyslogAMQPAttrs.

func NewInputSyslogKafkaAttrs

func NewInputSyslogKafkaAttrs() InputAttrs

NewInputSyslogKafkaAttrs is the constructor of InputSyslogKafkaAttrs.

func NewInputSyslogTCPAttrs

func NewInputSyslogTCPAttrs() InputAttrs

NewInputSyslogTCPAttrs is the constructor of InputSyslogTCPAttrs.

func NewInputSyslogUDPAttrs

func NewInputSyslogUDPAttrs() InputAttrs

NewInputSyslogUDPAttrs is the constructor of InputSyslogUDPAttrs.

type InputBeatsAttrs

type InputBeatsAttrs struct {
	BindAddress           string `json:"bind_address,omitempty" v-create:"required" v-update:"required"`
	OverrideSource        string `json:"override_source,omitempty"`
	TLSKeyFile            string `json:"tls_key_file,omitempty"`
	TLSKeyPassword        string `json:"tls_key_password,omitempty"`
	TLSClientAuthCertFile string `json:"tls_client_auth_cert_file,omitempty"`
	TLSClientAuth         string `json:"tls_client_auth,omitempty"`
	TLSCertFile           string `json:"tls_cert_file,omitempty"`
	TLSEnable             bool   `json:"tls_enable,omitempty"`
	TCPKeepAlive          bool   `json:"tcp_keepalive,omitempty"`
	Port                  int    `json:"port,omitempty" v-create:"required" v-update:"required"`
	RecvBufferSize        int    `json:"recv_buffer_size,omitempty" v-create:"required" v-update:"required"`
}

InputBeatsAttrs represents Beats Input's attributes.

func (InputBeatsAttrs) InputType

func (attrs InputBeatsAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputCEFAMQPAttrs

type InputCEFAMQPAttrs struct {
	Exchange               string `json:"exchange,omitempty"`
	Timezone               string `json:"timezone,omitempty"`
	BrokerPassword         string `json:"broker_password,omitempty"`
	Locale                 string `json:"locale,omitempty"`
	BrokerHostname         string `json:"broker_hostname,omitempty"`
	Queue                  string `json:"queue,omitempty"`
	BrokerVHost            string `json:"broker_vhost,omitempty"`
	BrokerUsername         string `json:"broker_username,omitempty"`
	RoutingKey             string `json:"routing_key,omitempty"`
	Heartbeat              int    `json:"heartbeat,omitempty"`
	ParallelQueues         int    `json:"parallel_queues,omitempty"`
	Prefetch               int    `json:"prefetch,omitempty"`
	BrokerPort             int    `json:"broker_port,omitempty"`
	ExchangeBind           bool   `json:"exchange_bind,omitempty"`
	RequeueInvalidMessages bool   `json:"requeue_invalid_messages,omitempty"`
	UseFullNames           bool   `json:"use_full_names,omitempty"`
	TLS                    bool   `json:"tls,omitempty"`
	ThrottlingAllowed      bool   `json:"throttling_allowed,omitempty"`
}

InputCEFAMQPAttrs represents CEF AMQP Input's attributes.

func (InputCEFAMQPAttrs) InputType

func (attrs InputCEFAMQPAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputCEFKafkaAttrs

type InputCEFKafkaAttrs struct {
	ThrottlingAllowed bool   `json:"throttling_allowed,omitempty"`
	UseFullNames      bool   `json:"use_full_names,omitempty"`
	Locale            string `json:"locale,omitempty"`
	Zookeeper         string `json:"zookeeper,omitempty"`
	Timezone          string `json:"timezone,omitempty"`
	TopicFilter       string `json:"topic_filter,omitempty"`
	OffsetReset       string `json:"offset_reset,omitempty"`
	Threads           int    `json:"threads,omitempty"`
	FetchWaitMax      int    `json:"fetch_wait_max,omitempty"`
	FetchMinBytes     int    `json:"fetch_min_bytes,omitempty"`
}

InputCEFKafkaAttrs represents CEF Kafka Input's attributes.

func (InputCEFKafkaAttrs) InputType

func (attrs InputCEFKafkaAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputCEFTCPAttrs

type InputCEFTCPAttrs struct {
	UseNullDelimiter      bool   `json:"use_null_delimiter,omitempty"`
	UseFullNames          bool   `json:"use_full_names,omitempty"`
	TLSEnable             bool   `json:"tls_enable,omitempty"`
	TCPKeepAlive          bool   `json:"tcp_keepalive,omitempty"`
	MaxMessageSize        int    `json:"max_message_size,omitempty"`
	Port                  int    `json:"port,omitempty" v-create:"required" v-update:"required"`
	RecvBufferSize        int    `json:"recv_buffer_size,omitempty" v-create:"required" v-update:"required"`
	Timezone              string `json:"timezone,omitempty"`
	Locale                string `json:"locale,omitempty"`
	BindAddress           string `json:"bind_address,omitempty" v-create:"required" v-update:"required"`
	TLSKeyFile            string `json:"tls_key_file,omitempty"`
	TLSClientAuth         string `json:"tls_client_auth,omitempty"`
	TLSKeyPassword        string `json:"tls_key_password,omitempty"`
	TLSClientAuthCertFile string `json:"tls_client_auth_cert_file,omitempty"`
	TLSCertFile           string `json:"tls_cert_file,omitempty"`
}

InputCEFTCPAttrs represents CEF TCP Input's attributes.

func (InputCEFTCPAttrs) InputType

func (attrs InputCEFTCPAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputCEFUDPAttrs

type InputCEFUDPAttrs struct {
	Locale         string `json:"locale,omitempty"`
	UseFullNames   bool   `json:"use_full_names,omitempty"`
	Timezone       string `json:"timezone,omitempty"`
	BindAddress    string `json:"bind_address,omitempty" v-create:"required" v-update:"required"`
	Port           int    `json:"port,omitempty" v-create:"required" v-update:"required"`
	RecvBufferSize int    `json:"recv_buffer_size,omitempty" v-create:"required" v-update:"required"`
}

InputCEFUDPAttrs represents CEF UDP Input's attributes.

func (InputCEFUDPAttrs) InputType

func (attrs InputCEFUDPAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputData

type InputData struct {
	Title         string                 `json:"title,omitempty"`
	Type          string                 `json:"type,omitempty"`
	ID            string                 `json:"id,omitempty"`
	Node          string                 `json:"node,omitempty"`
	CreatedAt     string                 `json:"created_at,omitempty"`
	CreatorUserID string                 `json:"creator_user_id,omitempty"`
	Global        bool                   `json:"global,omitempty"`
	Attrs         map[string]interface{} `json:"attributes,omitempty"`
}

InputData represents data of Input. This is used for data conversion of Input. ex. json.Unmarshal

func (*InputData) ToInput

func (d *InputData) ToInput(input *Input) error

ToInput copies InputData's data to Input.

type InputFakeHTTPMessageAttrs

type InputFakeHTTPMessageAttrs struct {
	Sleep             int    `json:"sleep,omitempty"`
	SleepDeviation    int    `json:"sleep_deviation,omitempty"`
	Source            string `json:"source,omitempty"`
	OverrideSource    string `json:"override_source,omitempty"`
	ThrottlingAllowed bool   `json:"throttling_allowed,omitempty"`
}

InputFakeHTTPMessageAttrs represents fake HTTP message Input's attributes.

func (InputFakeHTTPMessageAttrs) InputType

func (attrs InputFakeHTTPMessageAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputGELFAMQPAttrs

type InputGELFAMQPAttrs struct {
	ExchangeBind           bool   `json:"exchange_bind,omitempty"`
	ThrottlingAllowed      bool   `json:"throttling_allowed,omitempty"`
	TLS                    bool   `json:"tls,omitempty"`
	RequeueInvalidMessages bool   `json:"requeue_invalid_messages,omitempty"`
	BrokerVHost            string `json:"broker_vhost,omitempty"`
	BrokerUsername         string `json:"broker_username,omitempty"`
	Queue                  string `json:"queue,omitempty"`
	RoutingKey             string `json:"routing_key,omitempty"`
	OverrideSource         string `json:"override_source,omitempty"`
	BrokerHostname         string `json:"broker_hostname,omitempty"`
	Exchange               string `json:"exchange,omitempty"`
	BrokerPassword         string `json:"broker_password,omitempty"`
	Prefetch               int    `json:"prefetch,omitempty"`
	Heartbeat              int    `json:"heartbeat,omitempty"`
	DecompressSizeLimit    int    `json:"decompress_size_limit,omitempty"`
	BrokerPort             int    `json:"broker_port,omitempty"`
	ParallelQueues         int    `json:"parallel_queues,omitempty"`
}

InputGELFAMQPAttrs represents GELF AMQP Input's attributes.

func (InputGELFAMQPAttrs) InputType

func (attrs InputGELFAMQPAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputGELFHTTPAttrs

type InputGELFHTTPAttrs struct {
	IdleWriterTimeOut     int    `json:"idle_writer_timeout,omitempty"`
	RecvBufferSize        int    `json:"recv_buffer_size,omitempty" v-create:"required" v-update:"required"`
	MaxChunkSize          int    `json:"max_chunk_size,omitempty"`
	Port                  int    `json:"port,omitempty" v-create:"required" v-update:"required"`
	DecompressSizeLimit   int    `json:"decompress_size_limit,omitempty"`
	TLSClientAuthCertFile string `json:"tls_client_auth_cert_file,omitempty"`
	BindAddress           string `json:"bind_address,omitempty" v-create:"required" v-update:"required"`
	TLSCertFile           string `json:"tls_cert_file,omitempty"`
	TLSKeyFile            string `json:"tls_key_file,omitempty"`
	TLSKeyPassword        string `json:"tls_key_password,omitempty"`
	TLSClientAuth         string `json:"tls_client_auth,omitempty"`
	OverrideSource        string `json:"override_source,omitempty"`
	TCPKeepAlive          bool   `json:"tcp_keepalive,omitempty"`
	EnableCORS            bool   `json:"enable_cors,omitempty"`
	TLSEnable             bool   `json:"tls_enable,omitempty"`
}

InputGELFHTTPAttrs represents GELF HTTP Input's attributes.

func (InputGELFHTTPAttrs) InputType

func (attrs InputGELFHTTPAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputGELFKafkaAttrs

type InputGELFKafkaAttrs struct {
	OverrideSource      string `json:"override_source,omitempty"`
	DecompressSizeLimit int    `json:"decompress_size_limit,omitempty"`
	TopicFilter         string `json:"topic_filter,omitempty"`
	ThrottlingAllowed   bool   `json:"throttling_allowed,omitempty"`
	FetchWaitMax        int    `json:"fetch_wait_max,omitempty"`
	FetchMinBytes       int    `json:"fetch_min_bytes,omitempty"`
	OffsetReset         string `json:"offset_reset,omitempty"`
	Threads             int    `json:"threads,omitempty"`
	Zookeeper           string `json:"zookeeper,omitempty"`
}

InputGELFKafkaAttrs represents GELF Kafka Input's attributes.

func (InputGELFKafkaAttrs) InputType

func (attrs InputGELFKafkaAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputGELFTCPAttrs

type InputGELFTCPAttrs struct {
	MaxMessageSize        int    `json:"max_message_size,omitempty"`
	DecompressSizeLimit   int    `json:"decompress_size_limit,omitempty"`
	Port                  int    `json:"port,omitempty" v-create:"required" v-update:"required"`
	RecvBufferSize        int    `json:"recv_buffer_size,omitempty" v-create:"required" v-update:"required"`
	BindAddress           string `json:"bind_address,omitempty" v-create:"required" v-update:"required"`
	OverrideSource        string `json:"override_source,omitempty"`
	TLSKeyFile            string `json:"tls_key_file,omitempty"`
	TLSKeyPassword        string `json:"tls_key_password,omitempty"`
	TLSClientAuthCertFile string `json:"tls_client_auth_cert_file,omitempty"`
	TLSClientAuth         string `json:"tls_client_auth,omitempty"`
	TLSCertFile           string `json:"tls_cert_file,omitempty"`
	UseNullDelimiter      bool   `json:"use_null_delimiter,omitempty"`
	TLSEnable             bool   `json:"tls_enable,omitempty"`
	TCPKeepAlive          bool   `json:"tcp_keepalive,omitempty"`
}

InputGELFTCPAttrs represents GELF TCP Input's attributes.

func (InputGELFTCPAttrs) InputType

func (attrs InputGELFTCPAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputGELFUDPAttrs

type InputGELFUDPAttrs struct {
	DecompressSizeLimit int    `json:"decompress_size_limit,omitempty"`
	OverrideSource      string `json:"override_source,omitempty"`
	BindAddress         string `json:"bind_address,omitempty" v-create:"required" v-update:"required"`
	Port                int    `json:"port,omitempty" v-create:"required" v-update:"required"`
	RecvBufferSize      int    `json:"recv_buffer_size,omitempty" v-create:"required" v-update:"required"`
}

InputGELFUDPAttrs represents GELF UDP Input's attributes.

func (InputGELFUDPAttrs) InputType

func (attrs InputGELFUDPAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputJSONPathAttrs

type InputJSONPathAttrs struct {
	ThrottlingAllowed bool   `json:"throttling_allowed,omitempty"`
	OverrideSource    string `json:"override_source,omitempty"`
	Headers           string `json:"headers,omitempty"`
	Path              string `json:"path,omitempty"`
	TargetURL         string `json:"target_url,omitempty"`
	Interval          int    `json:"interval,omitempty"`
	Source            string `json:"source,omitempty"`
	Timeunit          string `json:"timeunit,omitempty"`
}

InputJSONPathAttrs represents JSON path Input's attributes.

func (InputJSONPathAttrs) InputType

func (attrs InputJSONPathAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputNetFlowUDPAttrs

type InputNetFlowUDPAttrs struct {
	NetFlow9DefinitionsPath string `json:"netflow9_definitions_path,omitempty"`
	OverrideSource          string `json:"override_source,omitempty"`
	BindAddress             string `json:"bind_address,omitempty" v-create:"required" v-update:"required"`
	Port                    int    `json:"port,omitempty" v-create:"required" v-update:"required"`
	RecvBufferSize          int    `json:"recv_buffer_size,omitempty" v-create:"required" v-update:"required"`
}

InputNetFlowUDPAttrs represents net flow UDP Input's attributes.

func (InputNetFlowUDPAttrs) InputType

func (attrs InputNetFlowUDPAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputRawAMQPAttrs

type InputRawAMQPAttrs struct {
	ParallelQueues         int    `json:"parallel_queues,omitempty"`
	HeartBeat              int    `json:"heartbeat,omitempty"`
	BrokerPort             int    `json:"broker_port,omitempty"`
	Prefetch               int    `json:"prefetch,omitempty"`
	RequeueInvalidMessages bool   `json:"requeue_invalid_messages,omitempty"`
	TLS                    bool   `json:"tls,omitempty"`
	ExchangeBind           bool   `json:"exchange_bind,omitempty"`
	ThrottlingAllowed      bool   `json:"throttling_allowed,omitempty"`
	Exchange               string `json:"exchange,omitempty"`
	RoutingKey             string `json:"routing_key,omitempty"`
	BrokerHostname         string `json:"broker_hostname,omitempty"`
	Queue                  string `json:"queue,omitempty"`
	BrokerPassword         string `json:"broker_password,omitempty"`
	BrokerVHost            string `json:"broker_vhost,omitempty"`
	BrokerUsername         string `json:"broker_username,omitempty"`
	OverrideSource         string `json:"override_source,omitempty"`
}

InputRawAMQPAttrs represents raw AMQP Input's attributes.

func (InputRawAMQPAttrs) InputType

func (attrs InputRawAMQPAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputSyslogAMQPAttrs

type InputSyslogAMQPAttrs struct {
	Heartbeat              int    `json:"heartbeat,omitempty"`
	Prefetch               int    `json:"prefetch,omitempty"`
	BrokerPort             int    `json:"broker_port,omitempty"`
	ParallelQueues         int    `json:"parallel_queues,omitempty"`
	BrokerVHost            string `json:"broker_vhost,omitempty"`
	BrokerUsername         string `json:"broker_username,omitempty"`
	BrokerPassword         string `json:"broker_password,omitempty"`
	Exchange               string `json:"exchange,omitempty"`
	OverrideSource         string `json:"override_source,omitempty"`
	RoutingKey             string `json:"routing_key,omitempty"`
	BrokerHostname         string `json:"broker_hostname,omitempty"`
	Queue                  string `json:"queue,omitempty"`
	ExchangeBind           bool   `json:"exchange_bind,omitempty"`
	ForceRDNS              bool   `json:"force_rdns,omitempty"`
	StoreFullMessage       bool   `json:"store_full_message,omitempty"`
	ExpandStructuredData   bool   `json:"expand_structured_data,omitempty"`
	ThrottlingAllowed      bool   `json:"throttling_allowed,omitempty"`
	TLS                    bool   `json:"tls,omitempty"`
	AllowOverrideDate      bool   `json:"allow_override_date,omitempty"`
	RequeueInvalidMessages bool   `json:"requeue_invalid_messages,omitempty"`
}

InputSyslogAMQPAttrs represents SyslogAMQP Input's attributes.

func (InputSyslogAMQPAttrs) InputType

func (attrs InputSyslogAMQPAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputSyslogKafkaAttrs

type InputSyslogKafkaAttrs struct {
	ForceRDNS            bool   `json:"force_rdns,omitempty"`
	StoreFullMessage     bool   `json:"store_full_message,omitempty"`
	ExpandStructuredData bool   `json:"expand_structured_data,omitempty"`
	AllowOverrideDate    bool   `json:"allow_override_date,omitempty"`
	ThrottlingAllowed    bool   `json:"throttling_allowed,omitempty"`
	OverrideSource       string `json:"override_source,omitempty"`
	TopicFilter          string `json:"topic_filter,omitempty"`
	FetchWaitMax         int    `json:"fetch_wait_max,omitempty"`
	OffsetReset          string `json:"offset_reset,omitempty"`
	Zookeeper            string `json:"zookeeper,omitempty"`
	FetchMinBytes        int    `json:"fetch_min_bytes,omitempty"`
	Threads              int    `json:"threads,omitempty"`
}

InputSyslogKafkaAttrs represents SyslogKafka Input's attributes.

func (InputSyslogKafkaAttrs) InputType

func (attrs InputSyslogKafkaAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputSyslogTCPAttrs

type InputSyslogTCPAttrs struct {
	Port           int    `json:"port,omitempty" v-create:"required" v-update:"required"`
	BindAddress    string `json:"bind_address,omitempty" v-create:"required" v-update:"required"`
	RecvBufferSize int    `json:"recv_buffer_size,omitempty" v-create:"required" v-update:"required"`
}

InputSyslogTCPAttrs represents SyslogTCP Input's attributes.

func (InputSyslogTCPAttrs) InputType

func (attrs InputSyslogTCPAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputSyslogUDPAttrs

type InputSyslogUDPAttrs struct {
	BindAddress            string `json:"bind_address,omitempty" v-create:"required" v-update:"required"`
	Port                   int    `json:"port,omitempty" v-create:"required" v-update:"required"`
	RecvBufferSize         int    `json:"recv_buffer_size,omitempty" v-create:"required" v-update:"required"`
	TCPKeepAlive           bool   `json:"tcp_keepalive,omitempty"`
	TLSEnable              bool   `json:"tls_enable,omitempty"`
	ThrottlingAllowed      bool   `json:"throttling_allowed,omitempty"`
	EnableCORS             bool   `json:"enable_cors,omitempty"`
	UseNullDelimiter       bool   `json:"use_null_delimiter,omitempty"`
	ExchangeBind           bool   `json:"exchange_bind,omitempty"`
	ForceRDNS              bool   `json:"force_rdns,omitempty"`
	StoreFullMessage       bool   `json:"store_full_message,omitempty"`
	ExpandStructuredData   bool   `json:"expand_structured_data,omitempty"`
	AllowOverrideDate      bool   `json:"allow_override_date,omitempty"`
	RequeueInvalidMessages bool   `json:"requeue_invalid_messages,omitempty"`
	UseFullNames           bool   `json:"use_full_names,omitempty"`
	TLS                    bool   `json:"tls,omitempty"`
}

InputSyslogUDPAttrs represents SyslogUDP Input's attributes.

func (InputSyslogUDPAttrs) InputType

func (attrs InputSyslogUDPAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputUnknownAttrs

type InputUnknownAttrs struct {
	Data map[string]interface{}
	// contains filtered or unexported fields
}

InputUnknownAttrs represents unknown type's Input Attrs.

func (InputUnknownAttrs) InputType

func (attrs InputUnknownAttrs) InputType() string

InputType is the implementation of the InputAttrs interface.

type InputUpdateParams

type InputUpdateParams struct {
	ID     string     `json:"id,omitempty" v-update:"required,objectid"`
	Title  string     `json:"title,omitempty" v-update:"required"`
	Type   string     `json:"type,omitempty" v-update:"required"`
	Attrs  InputAttrs `json:"attributes,omitempty" v-update:"required"`
	Global *bool      `json:"global,omitempty"`
	Node   string     `json:"node,omitempty"`
}

InputUpdateParams represents Graylog Input update API's parameter.

type InputUpdateParamsData

type InputUpdateParamsData struct {
	ID     string                 `json:"id,omitempty"`
	Title  string                 `json:"title,omitempty"`
	Type   string                 `json:"type,omitempty"`
	Node   string                 `json:"node,omitempty"`
	Global *bool                  `json:"global,omitempty"`
	Attrs  map[string]interface{} `json:"attributes,omitempty"`
}

InputUpdateParamsData represents InputUpdateParams's data. This is used for data conversion of InputUpdateParams. ex. json.Unmarshal

func (*InputUpdateParamsData) ToInputUpdateParams

func (d *InputUpdateParamsData) ToInputUpdateParams(input *InputUpdateParams) error

ToInputUpdateParams copies InputUpdateParamsData's data to InputUpdateParams.

type InputsBody

type InputsBody struct {
	Inputs []Input `json:"inputs"`
	Total  int     `json:"total"`
}

InputsBody represents Get Inputs API's response body. Basically users don't use this struct, but this struct is public because some sub packages use this struct.

type NewInputAttrs

type NewInputAttrs func() InputAttrs

NewInputAttrs is the constructor of InputAttrs.

type Output

type Output struct{}

Output represents an output.

type Preferences

type Preferences struct {
	UpdateUnfocussed  bool `json:"updateUnfocussed,omitempty"`
	EnableSmartSearch bool `json:"enableSmartSearch,omitempty"`
}

Preferences represents user's preferences.

type RetentionStrategy

type RetentionStrategy struct {
	// ex. "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfig"
	Type string `json:"type,omitempty"`
	// ex. 20
	MaxNumberOfIndices int `json:"max_number_of_indices,omitempty"`
}

RetentionStrategy represents a Graylog's Index Set Retention Strategy.

func NewClosingRetentionStrategy

func NewClosingRetentionStrategy(num int) *RetentionStrategy

NewClosingRetentionStrategy returns a new closing RetentionStrategy.

func NewDeletionRetentionStrategy

func NewDeletionRetentionStrategy(num int) *RetentionStrategy

NewDeletionRetentionStrategy returns a new deletion RetentionStrategy.

func NewNoopRetentionStrategy

func NewNoopRetentionStrategy(num int) *RetentionStrategy

NewNoopRetentionStrategy returns a new noop RetentionStrategy.

type Role

type Role struct {
	Name        string `json:"name,omitempty" v-create:"required" v-update:"required"`
	Description string `json:"description,omitempty"`
	// ex. ["clusterconfigentry:read", "users:edit"]
	Permissions set.StrSet `json:"permissions,omitempty" v-create:"required" v-update:"required"`
	ReadOnly    bool       `json:"read_only,omitempty"`
}

Role represents a role.

func (*Role) NewUpdateParams

func (role *Role) NewUpdateParams() *RoleUpdateParams

NewUpdateParams returns Update Role API's parameters.

type RoleUpdateParams

type RoleUpdateParams struct {
	Name        string  `json:"name,omitempty" v-create:"required" v-update:"required"`
	Description *string `json:"description,omitempty"`
	// ex. ["clusterconfigentry:read", "users:edit"]
	Permissions set.StrSet `json:"permissions,omitempty" v-create:"required" v-update:"required"`
}

RoleUpdateParams represents Update Role API's parameters.

type RolesBody

type RolesBody struct {
	Roles []Role `json:"roles"`
	Total int    `json:"total"`
}

RolesBody represents Get Roles API's response body. Basically users don't use this struct, but this struct is public because some sub packages use this struct.

type RotationStrategy

type RotationStrategy struct {
	// ex. "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyConfig"
	Type string `json:"type,omitempty"`
	// ex. 20000000
	// Maximum number of documents in an index before it gets rotated
	MaxDocsPerIndex int `json:"max_docs_per_index,omitempty"`
	// time based
	// How long an index gets written to before it is rotated. (i.e. "P1D" for 1 day, "PT6H" for 6 hours)
	RotationPeriod string `json:"rotation_period,omitempty"`
	// size based
	// Maximum size of an index before it gets rotated
	MaxSize int `json:"max_size,omitempty"`
}

RotationStrategy represents a Graylog's Index Set Rotation Strategy.

func NewMessageCountRotationStrategy

func NewMessageCountRotationStrategy(count int) *RotationStrategy

NewMessageCountRotationStrategy returns a new message count based RotationStrategy.

func NewSizeBasedRotationStrategy

func NewSizeBasedRotationStrategy(size int) *RotationStrategy

NewSizeBasedRotationStrategy returns a new size based RotationStrategy.

func NewTimeBasedRotationStrategy

func NewTimeBasedRotationStrategy(period string) *RotationStrategy

NewTimeBasedRotationStrategy returns a new time based RotationStrategy.

type Startpage

type Startpage struct {
	Type string `json:"type,omitempty"`
	ID   string `json:"id,omitempty"`
}

Startpage represents a user's startpage.

type Stream

type Stream struct {
	ID         string `json:"id,omitempty" v-create:"isdefault" v-update:"required,objectid"`
	Title      string `json:"title,omitempty" v-create:"required"`
	IndexSetID string `json:"index_set_id,omitempty" v-create:"required"`
	// ex. "2018-02-20T11:37:19.371Z"
	CreatedAt string `json:"created_at,omitempty" v-create:"isdefault"`
	// ex. local:admin
	CreatorUserID string `json:"creator_user_id,omitempty" v-create:"isdefault"`
	Description   string `json:"description,omitempty"`
	// ex. "AND"
	MatchingType                   string           `json:"matching_type,omitempty"`
	Outputs                        []Output         `json:"outputs,omitempty" v-create:"isdefault"`
	Rules                          []StreamRule     `json:"rules,omitempty"`
	AlertConditions                []AlertCondition `json:"alert_conditions,omitempty" v-create:"isdefault"`
	AlertReceivers                 *AlertReceivers  `json:"alert_receivers,omitempty" v-create:"isdefault"`
	Disabled                       bool             `json:"disabled,omitempty" v-create:"isdefault"`
	RemoveMatchesFromDefaultStream bool             `json:"remove_matches_from_default_stream,omitempty"`
	IsDefault                      bool             `json:"is_default,omitempty" v-create:"isdefault"`
}

Stream represents a steram.

func (*Stream) NewUpdateParams

func (stream *Stream) NewUpdateParams() *StreamUpdateParams

NewUpdateParams converts Stream to StreamUpdateParams.

type StreamRule

type StreamRule struct {
	ID          string `json:"id,omitempty" v-create:"isdefault"`
	StreamID    string `json:"stream_id,omitempty" v-create:"required"`
	Field       string `json:"field,omitempty" v-create:"required"`
	Value       string `json:"value,omitempty" v-create:"required"`
	Description string `json:"description,omitempty"`
	Type        int    `json:"type,omitempty"`
	Inverted    bool   `json:"inverted,omitempty"`
}

StreamRule represents a stream rule.

func (*StreamRule) NewUpdateParams

func (rule *StreamRule) NewUpdateParams() *StreamRuleUpdateParams

NewUpdateParams converts StreamRule to StreamRuleUpdateParams.

type StreamRuleUpdateParams

type StreamRuleUpdateParams struct {
	ID          string `json:"id,omitempty" v-update:"required,objectid"`
	StreamID    string `json:"stream_id,omitempty" v-update:"required,objectid"`
	Field       string `json:"field,omitempty" v-update:"required"`
	Value       string `json:"value,omitempty" v-update:"required"`
	Description string `json:"description,omitempty"`
	Type        *int   `json:"type,omitempty"`
	Inverted    *bool  `json:"inverted,omitempty"`
}

StreamRuleUpdateParams represents Update Stream API's paramteres.

type StreamRulesBody

type StreamRulesBody struct {
	Total       int          `json:"total"`
	StreamRules []StreamRule `json:"stream_rules"`
}

StreamRulesBody represents Get stream rules API's response body. Basically users don't use this struct, but this struct is public because some sub packages use this struct.

type StreamUpdateParams

type StreamUpdateParams struct {
	ID                             string           `json:"id,omitempty" v-update:"required,objectid"`
	Title                          string           `json:"title,omitempty"`
	IndexSetID                     string           `json:"index_set_id,omitempty"`
	Description                    string           `json:"description,omitempty"`
	Outputs                        []Output         `json:"outputs,omitempty"`
	MatchingType                   string           `json:"matching_type,omitempty"`
	Rules                          []StreamRule     `json:"rules,omitempty"`
	AlertConditions                []AlertCondition `json:"alert_conditions,omitempty"`
	AlertReceivers                 *AlertReceivers  `json:"alert_receivers,omitempty"`
	RemoveMatchesFromDefaultStream *bool            `json:"remove_matches_from_default_stream,omitempty"`
}

StreamUpdateParams represents a steram update params.

type StreamsBody

type StreamsBody struct {
	Total   int      `json:"total,omitempty"`
	Streams []Stream `json:"streams,omitempty"`
}

StreamsBody represents Get Streams API's response body. Basically users don't use this struct, but this struct is public because some sub packages use this struct.

type Timerange added in v0.4.0

type Timerange struct {
	Type  string `json:"timerange"`
	Range int    `json:"range"`
}

Timerange represents a timerange.

type User

type User struct {
	// a unique user name used to log in with.
	// ex. "local:admin"
	Username string `json:"username,omitempty" v-create:"required" v-update:"required"`
	// the contact email address
	Email string `json:"email,omitempty" v-create:"required"`
	// a descriptive name for this account, e.g. the full name.
	FullName string `json:"full_name,omitempty" v-create:"required"`
	Password string `json:"password,omitempty" v-create:"required"`

	ID string `json:"id,omitempty"`
	// the timezone to use to display times, or leave it as it is to use the system's default.
	// ex. "UTC"
	Timezone string `json:"timezone,omitempty"`
	// ex. "2018-03-02T06:32:01.841+0000"
	LastActivity string `json:"last_activity,omitempty"`
	// ex. "192.168.192.1"
	ClientAddress string `json:"client_address,omitempty"`
	// Session automatically end after this amount of time, unless they are actively used.
	// ex. 28800000
	SessionTimeoutMs int          `json:"session_timeout_ms,omitempty"`
	External         bool         `json:"external,omitempty"`
	ReadOnly         bool         `json:"read_only,omitempty"`
	SessionActive    bool         `json:"session_active,omitempty"`
	Preferences      *Preferences `json:"preferences,omitempty"`
	Startpage        *Startpage   `json:"startpage,omitempty"`
	// Assign the relevant roles to this user to grant them access to the relevant streams and dashboards.
	// The Reader role grants basic access to the system and will be enabled.
	// The Admin role grants access to everything in Graylog.
	// ex. ["Admin"]
	Roles       set.StrSet `json:"roles,omitempty"`
	Permissions set.StrSet `json:"permissions,omitempty" v-create:"required"`
}

User represents a user.

func (*User) NewUpdateParams

func (user *User) NewUpdateParams() *UserUpdateParams

NewUpdateParams returns Update User API's parameters.

func (*User) SetDefaultValues

func (user *User) SetDefaultValues()

SetDefaultValues sets default values.

type UserUpdateParams

type UserUpdateParams struct {
	Username         string     `json:"username,omitempty" v-update:"required"`
	Email            *string    `json:"email,omitempty"`
	FullName         *string    `json:"full_name,omitempty"`
	Password         *string    `json:"password,omitempty"`
	Timezone         *string    `json:"timezone,omitempty"`
	SessionTimeoutMs *int       `json:"session_timeout_ms,omitempty"`
	Permissions      set.StrSet `json:"permissions,omitempty"`
	Startpage        *Startpage `json:"startpage,omitempty"`
	Roles            set.StrSet `json:"roles,omitempty"`
}

UserUpdateParams represents a user update API's parameter.

type UsersBody

type UsersBody struct {
	Users []User `json:"users"`
}

UsersBody represents Get Users API's response body. Basically users don't use this struct, but this struct is public because some sub packages use this struct.

type Widget added in v0.4.0

type Widget struct {
	// ex. "STREAM_SEARCH_RESULT_COUNT"
	Type          string        `json:"type,omitempty"`
	CreatorUserID string        `json:"creator_user_id,omitempty" v-create:"isdefault"`
	ID            string        `json:"id,omitempty" v-create:"isdefault"`
	CacheTime     int           `json:"cache_time,omitempty" v-create:"isdefault"`
	Config        *WidgetConfig `json:"config,omitempty"`
}

Widget represents a Graylog's Dashboard Widget.

type WidgetConfig added in v0.4.0

type WidgetConfig struct {
	Timerange     *Timerange `json:"timerange"`
	LowerIsBetter bool       `json:"lower_is_better"`
	Trend         bool       `json:"trend"`
	StreamID      string     `json:"stream_id,omitempty" v-create:"isdefault"`
	Query         string     `json:"query,omitempty" v-create:"isdefault"`
}

WidgetConfig represents a Graylog's Dashboard Widget configuration.

Directories

Path Synopsis
Package client provides Graylog API client.
Package client provides Graylog API client.
endpoint
Package endpoint provides Graylog API endpoints.
Package endpoint provides Graylog API endpoints.
Package mockserver provides Graylog API mock server.
Package mockserver provides Graylog API mock server.
exec
Run Graylog mock server.
Run Graylog mock server.
handler
Package handler provides handlers of Graylog API mock server.
Package handler provides handlers of Graylog API mock server.
logic
Package logic provides logic layers of Graylog API mock server.
Package logic provides logic layers of Graylog API mock server.
store
Package store provides store interface for Graylog API mock server.
Package store provides store interface for Graylog API mock server.
store/plain
Package plain provides the implementation of store.Store interface.
Package plain provides the implementation of store.Store interface.
graylog
Package graylog provides the terraform provider for Graylog.
Package graylog provides the terraform provider for Graylog.
Package testutil provides utilities for test.
Package testutil provides utilities for test.
Package validator provides validators for graylog's create and update APIs.
Package validator provides validators for graylog's create and update APIs.

Jump to

Keyboard shortcuts

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