outputamqp

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

README

gogstash output amqp

Synopsis

{
	"output": [
		{
			"type": "amqp",

			// Array of AMQP connection strings formatted per the [RabbitMQ URI Spec](http://www.rabbitmq.com/uri-spec.html). Required.
			// Note: the connections will be used in a round-robin fashions
			"urls": [
				"amqp://guest:guest@localhost:5672//vhost"
			],

			// CA Certs to verify self-signed certificates
			"tls_ca_certs": [
				"cacert.pem"
			],

			// Certs to use to connect to TLS host
			"tls_certs": [
				"cert.pem"
			],

			// Cert Keys to connect to TLS host
			"tls_cert_keys": [
				"key.pem"
			],

			// Skip verification of certificates
			"tls_skip_verify": true,

			// The message routing key used to bind the queue to the exchange. Defaults to empty string.
			"routing_key": "%{fieldstring}"

			// AMQP exchange name. Required.
			"exchange": "amq.topic",

			// AMQP exchange type (fanout, direct, topic or headers).
			"exchange_type": "topic",

			// Whether the exchange should be configured as a durable exchange. Defaults to false.
			"exchange_durable": false,

			// Whether the exchange is deleted when all queues have finished and there is no publishing. Defaults to false.
			"exchange_auto_delete": false,

			// Whether published messages should be marked as persistent or transient. Defaults to false.
			"persistent": false,

			// Number of attempts for sending a message. Defaults to 3.
			"retries": 3,

			// Delay between each attempt to reconnect to AMQP server. Defaults to 30 seconds.
			"reconnect_delay": 30
		}
	]
}

Documentation

Index

Constants

View Source
const ModuleName = "amqp"

ModuleName is the name used in config file

Variables

View Source
var (
	ErrorNoValidConn = errutil.NewFactory("no valid amqp server connection found")
)

errors

Functions

func InitHandler

func InitHandler(
	ctx context.Context,
	raw config.ConfigRaw,
	control config.Control,
) (config.TypeOutputConfig, error)

InitHandler initialize the output plugin

Types

type OutputConfig

type OutputConfig struct {
	config.OutputConfig
	URLs               []string `json:"urls"`                           // Array of AMQP connection strings formatted per the [RabbitMQ URI Spec](http://www.rabbitmq.com/uri-spec.html).
	TLSCACerts         []string `json:"tls_ca_certs,omitempty"`         // Array of CA Certificates to load for TLS connections
	TLSCerts           []string `json:"tls_certs,omitempty"`            // Array of Certificates to load for TLS connections
	TLSCertKeys        []string `json:"tls_cert_keys,omitempty"`        // Array of Certificate Keys to load for TLS connections (Must NOT be password protected)
	TLSSkipVerify      bool     `json:"tls_cert_skip_verify,omitempty"` // Skip verification of certifcates. Defaults to false.
	RoutingKey         string   `json:"routing_key,omitempty"`          // The message routing key used to bind the queue to the exchange. Defaults to empty string.
	Exchange           string   `json:"exchange"`                       // AMQP exchange name
	ExchangeType       string   `json:"exchange_type"`                  // AMQP exchange type (fanout, direct, topic or headers).
	ExchangeDurable    bool     `json:"exchange_durable,omitempty"`     // Whether the exchange should be configured as a durable exchange. Defaults to false.
	ExchangeAutoDelete bool     `json:"exchange_auto_delete,omitempty"` // Whether the exchange is deleted when all queues have finished and there is no publishing. Defaults to true.
	Persistent         bool     `json:"persistent,omitempty"`           // Whether published messages should be marked as persistent or transient. Defaults to false.
	Retries            int      `json:"retries,omitempty"`              // Number of attempts to send a message. Defaults to 3.
	ReconnectDelay     int      `json:"reconnect_delay,omitempty"`      // Delay between each attempt to reconnect to AMQP server. Defaults to 30 seconds.
	// contains filtered or unexported fields
}

OutputConfig holds the configuration json fields and internal objects

func DefaultOutputConfig

func DefaultOutputConfig() OutputConfig

DefaultOutputConfig returns an OutputConfig struct with default values

func (*OutputConfig) Output

func (o *OutputConfig) Output(ctx context.Context, event logevent.LogEvent) (err error)

Output send the event through AMQP

Jump to

Keyboard shortcuts

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