Skip to content

ww_mqtt_3

Pushes messages to an MQTT broker.

# Common config fields, showing default values
output:
label: ""
ww_mqtt_3:
urls:
- tcp://localhost:1883
client_id: ""
topic: "" # No default (required)
qos: 0
retained: false
write_timeout: 5s
connect_timeout: 5s
connect_retry: true
connect_retry_interval: 1s
keepalive: 60s
auth:
username: ""
password: ""
will:
topic: "" # No default (required)
payload: ""
qos: 0
retained: false

Uses mqtt output component found in wombatwisdom/components.

Fields

urls

List of MQTT broker URLs to connect to.

Type: array

Default: ["tcp://localhost:1883"]

client_id

Unique client identifier. If empty, one will be generated.

Type: string

Default: ""

topic

Topic to publish to. Can contain interpolation functions. This field supports interpolation functions.

Type: string

qos

Quality of Service level (0, 1, or 2)

Type: int

Default: 0

clean_session

Start with a clean session. When set to true this will set the “clean session” flag in the connect message when the underlying MQTT client connects to an MQTT broker. By setting this flag, you are indicating that no messages saved by the broker for this client should be delivered. Any messages that were going to be sent by this client before disconnecting previously but didn’t will not be sent upon connecting to the broker.

Type: bool

Default: true

retained

Set the retained flag on published messages

Type: bool

Default: false

write_timeout

Timeout for write operations

Type: string

Default: "5s"

connect_timeout

Connection timeout limits how long the client will wait when trying to open a connection to an MQTT server before timing out. A duration of 0 never times out. Defaults to 5 seconds. Currently only operational on TCP/TLS connections.

Type: string

Default: "5s"

connect_retry

Connect retry sets whether the MQTT client will automatically retry the connection in the event of a failure. Defaults to true.

Type: bool

Default: true

connect_retry_interval

Connection retry interval sets the time that will be waited between connection attempts when initially connecting if connect_retry is set to true.

Type: string

Default: "1s"

keepalive

Keep alive interval

Type: string

Default: "60s"

auth

Authentication configuration

Type: object

auth.username

Username for authentication

Type: string

Default: ""

auth.password

Password for authentication

Type: string

Default: ""

tls

TLS configuration for secure connections

Type: object

tls.enabled

Whether custom TLS settings are enabled.

Type: bool

Default: false

tls.skip_cert_verify

Whether to skip server side certificate verification.

Type: bool

Default: false

tls.enable_renegotiation

Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you’re seeing the error message local error: tls: no renegotiation.

Type: bool

Default: false Requires version 3.45.0 or newer

tls.root_cas

An optional root certificate authority to use. This is a string, representing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.

Type: string

Default: ""

# Examples
root_cas: |-
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

tls.root_cas_file

An optional path of a root certificate authority file to use. This is a file, often with a .pem extension, containing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.

Type: string

Default: ""

# Examples
root_cas_file: ./root_cas.pem

tls.client_certs

A list of client certificates to use. For each certificate either the fields cert and key, or cert_file and key_file should be specified, but not both.

Type: array

Default: []

# Examples
client_certs:
- cert: foo
key: bar
client_certs:
- cert_file: ./example.pem
key_file: ./example.key

tls.client_certs[].cert

A plain text certificate to use.

Type: string

Default: ""

tls.client_certs[].key

A plain text certificate key to use.

Type: string

Default: ""

tls.client_certs[].cert_file

The path of a certificate to use.

Type: string

Default: ""

tls.client_certs[].key_file

The path of a certificate key to use.

Type: string

Default: ""

tls.client_certs[].password

A plain text password for when the private key is password encrypted in PKCS#1 or PKCS#8 format. The obsolete pbeWithMD5AndDES-CBC algorithm is not supported for the PKCS#8 format.

Because the obsolete pbeWithMD5AndDES-CBC algorithm does not authenticate the ciphertext, it is vulnerable to padding oracle attacks that can let an attacker recover the plaintext.

Type: string

Default: ""

# Examples
password: foo
password: ${KEY_PASSWORD}

will

Last Will and Testament configuration

Type: object

will.topic

Topic for will message

Type: string

will.payload

Payload for will message

Type: string

Default: ""

will.qos

QoS level for will message (0, 1, or 2)

Type: int

Default: 0

will.retained

Retained flag for will message

Type: bool

Default: false