---
title: "mqtt(): Send messages from a local network to an MQTT broker"
url: "https://axoflow.com/docs/axosyslog-core/4.28/chapter-destinations/destination-mqtt-intro/"
last_modified: "2026-08-02T11:39:11+02:00"
---

> For the complete documentation index, see [llms.txt](https://axoflow.com/docs/axosyslog-core/4.28/llms.txt).

# mqtt(): Send messages from a local network to an MQTT broker

AxoSyslog can use the `mqtt()` destination to publish messages to MQTT brokers.

The mqtt() destination builds on the [MQTT protocol](https://www.hivemq.com/mqtt-protocol/), and uses its “[client](https://www.hivemq.com/blog/seven-best-mqtt-client-tools/)” and “[broker](https://www.hivemq.com/hivemq/mqtt-broker/)” entities.

> **Note:**
> The rest of this chapter and its sections build on your familiarity with the MQTT protocol, the concept of client and broker entities, and how these entities function within an MQTT system.

## Prerequisites

- AxoSyslog version 3.33 or later.
- This feature requires a separate module. Install the `axosyslog-mod-mqtt` package on [Debian/Ubuntu](https://axoflow.com/docs/axosyslog-core/4.28/install/debian-ubuntu/index.md), or the `axosyslog-mqtt` package on [RHEL and compatible distributions](https://axoflow.com/docs/axosyslog-core/4.28/install/rhel-fedora-almalinux/index.md). If the module isn’t installed, AxoSyslog fails to start with an [`unexpected LL_IDENTIFIER` error](https://axoflow.com/docs/axosyslog-core/4.28/chapter-troubleshooting-syslog-ng/unexpected-ll-identifier/index.md).

## Declaration:

```shell
   destination d_mqtt {
      mqtt(
        topic("<topic-name>"),
        address("tcp://localhost:<port-number>"),
        fallback_topic("<fallback-topic-name>")
      );
    }
```

## Example: Using the mqtt() destination in your configuration

The following example illustrates a `mqtt()` destination configured to fetch messages from the `localhost:4444` address, and send them to the broker running on `localhost:4445`, using the `mqtt test/test` topic.

```shell
   @version: 3.32
    @include "scl.conf"

      source s_net {
        network(port(4444)
      );
    };

      destination d_mqtt {
        mqtt(topic("test/test"), address("tcp://localhost:4445"), fallback_topic("test/test")
      );
    };

    log {
      source(s_net);
      destination( d_mqtt);
    };
```

---

[Prerequisites to using the mqtt() destination](https://axoflow.com/docs/axosyslog-core/4.28/chapter-destinations/destination-mqtt-intro/destination-mqtt-prer/index.md)

[Limitations to using the mqtt() destination](https://axoflow.com/docs/axosyslog-core/4.28/chapter-destinations/destination-mqtt-intro/destination-mqtt-lim/index.md)

[Options of the mqtt() destination](https://axoflow.com/docs/axosyslog-core/4.28/chapter-destinations/destination-mqtt-intro/destination-mqtt-options/index.md)

[Possible error messages you may encounter while using the mqtt() destination](https://axoflow.com/docs/axosyslog-core/4.28/chapter-destinations/destination-mqtt-intro/destination-mqtt-error/index.md)

Last modified August 2, 2026: [Adds required modules/packages to install and destination pages (553d6d9b)](https://github.com/axoflow/axosyslog-core-docs/commit/553d6d9be9a0e3ef444e62cc5351dd2ac764f01d)
