duct.outputs

duct.outputs.bosun

class duct.outputs.bosun.Bosun(*a)[source]

Bases: duct.outputs.opentsdb.OpenTSDB

Bosun HTTP API output

Configuration arguments:

Parameters:
  • url (str.) – URL (default: http://localhost:4242)
  • maxsize (int.) – Maximum queue backlog size (default: 250000, 0 disables)
  • maxrate (int.) – Maximum rate of documents added to index (default: 100)
  • interval (int.) – Queue check interval in seconds (default: 1.0)
  • user (str.) – Optional basic auth username
  • password (str.) – Optional basic auth password
  • debug (bool.) – Log tracebacks from OpenTSDB

duct.outputs.elasticsearch

class duct.outputs.elasticsearch.ElasticSearch(*a)[source]

Bases: duct.objects.Output

ElasticSearch HTTP API output

Configuration arguments:

Parameters:
  • url (str) – Elasticsearch URL (default: http://localhost:9200)
  • maxsize (int) – Maximum queue backlog size (default: 250000, 0 disables)
  • maxrate (int) – Maximum rate of documents added to index (default: 100)
  • interval (int) – Queue check interval in seconds (default: 1.0)
  • user (str) – Optional basic auth username
  • password (str) – Optional basic auth password
  • index (str) – Index name format to store documents in Elastic (default: duct-%Y.%m.%d)
createClient()[source]

Sets up HTTP connector and starts queue timer

stop()[source]

Stop this client.

tick(*args, **kwargs)[source]

Clock tick called every self.inter

duct.outputs.elasticsearch.ElasticSearchLog

alias of ElasticSearch

duct.outputs.logger

class duct.outputs.logger.Logger(*a, **kw)[source]

Bases: duct.objects.Output

Logger output

Configuration arguments:

Parameters:logfile (str) – Logfile (default: Write to standard log)

duct.outputs.opentsdb

class duct.outputs.opentsdb.OpenTSDB(*a)[source]

Bases: duct.objects.Output

OpenTSDB HTTP API output

Configuration arguments:

Parameters:
  • url (str) – URL (default: http://localhost:4242)
  • maxsize (int) – Maximum queue backlog size (default: 250000, 0 disables)
  • maxrate (int) – Maximum rate of documents added to index (default: 100)
  • interval (int) – Queue check interval in seconds (default: 1.0)
  • user (str) – Optional basic auth username
  • password (str) – Optional basic auth password
  • debug (str) – Log tracebacks from OpenTSDB
createClient()[source]

Sets up HTTP connector and starts queue timer

stop()[source]

Stop this client.

tick(*args, **kwargs)[source]

Clock tick called every self.inter

transformEvent(ev)[source]

Convert an event object into OpenTSDB format

duct.outputs.riemann

class duct.outputs.riemann.RiemannTCP(*a)[source]

Bases: duct.objects.Output

Riemann TCP output

Configuration arguments:

Parameters:
  • server (str.) – Riemann server hostname (default: localhost)
  • port (int.) – Riemann server port (default: 5555)
  • failover (bool.) – Enable server failover, in which case server may be a list
  • maxrate (int.) – Maximum de-queue rate (0 is no limit)
  • maxsize (int.) – Maximum queue size (0 is no limit, default is 250000)
  • interval (float.) – De-queue interval in seconds (default: 1.0)
  • pressure (int.) – Maximum backpressure (-1 is no limit)
  • tls (bool.) – Use TLS (default false)
  • cert (str.) – Host certificate path
  • key (str.) – Host private key path
  • allow_nan (bool) – Send events with None metric value (default true)
createClient()[source]

Create a TCP connection to Riemann with automatic reconnection

emptyQueue()[source]

Remove all or self.queueDepth events from the queue

stop()[source]

Stop this client.

tick()[source]

Clock tick called every self.inter

class duct.outputs.riemann.RiemannUDP(*a)[source]

Bases: duct.objects.Output

Riemann UDP output (spray-and-pray mode)

Configuration arguments:

Parameters:
  • server (str.) – Riemann server IP address (default: 127.0.0.1)
  • port (int.) – Riemann server port (default: 5555)
createClient()[source]

Create a UDP connection to Riemann

eventsReceived(events)[source]

Receives a list of events and transmits them to Riemann

Arguments: events – list of duct.objects.Event