> For the complete documentation index, see [llms.txt](https://docs.umh.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umh.app/benthos-umh/output/uns-output.md).

# UNS (Output)

> **Works exclusively with UMH Core**

## 1 Quick-start (99 % of users)

```yaml
pipeline:
  processors:
    - tag_processor:            # or Bloblang / Node-RED JS
        defaults: |
          // Minimal example
          msg.meta.location_path = "enterprise.plant1.machiningArea.cnc-line.cnc5.plc123";
          msg.meta.data_contract = "_historian";
          msg.meta.tag_name      = "value";
          // tag_processor now auto-creates msg.meta.umh_topic
          return msg;

output:
  uns: {}                       # nothing else needed on UMH Core. Will automatically use msg.meta.umh_topic from the tag_processor and write to the internal redpanda.
```

*Open the **Topic Browser** (Management Console → Unified Namespace) to watch the live values.*

## 2 - Optional overrides

```yaml
output:
  uns:
    umh_topic:      "${! meta(\"umh_topic\") }"   # Must follow `umh.v1.<…>` naming. If not specified, will take the `umh_topic` from the metadata fields (e.g., from msg.meta.umh_topic)
    bridged_by:     "umh-core"                    # Traceability header. Default `umh-core`; overridden automatically by protocol-converters inside UMH Core.
```

## 3 - What the plugin does behind the scenes

1. **Batching** 100 messages *or* 100 ms – whichever comes first.
2. **Sanitising** Illegal chars in the key become "\_".
3. **Kafka/Redpanda** Each message will be stored in the Kafka topic `umh.messages` with the Kafka key of the umh\_topic
4. **Headers** All Benthos metadata (except `kafka_*`) plus `bridged_by` are forwarded as Kafka headers.
5. **Topic check** If `umh.messages` is missing the plugin creates it (1 partition, `compact,delete`).

## Troubleshooting / FAQs

* **"topic is not set or is empty"** – your pipeline never wrote `msg.meta.umh_topic`. Add a `tag_processor` (auto) or a Bloblang line: `meta umh_topic = "umh.v1.demo.plant1.line1._historian.temperature"`
* **I am not using umh-core, but I still want to use the uns output plugin. How can I do that?** - there is a configuration variable called `broker_address` which you can point to any redpanda broker.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.umh.app/benthos-umh/output/uns-output.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
