---
title: Subscribe to Live Tag Updates via Web Sockets
description: Follow the steps below to subscribe to tags and receive realtime tag updates (last value) via Web Sockets. The example will be using Postman.
---

[Skip to content](https://docs.timebase.flow-software.com/knowledge-base/timebase-real-time-historian-subscribe-to-tag-changes-via-web-sockets#main-content)

[More support](https://docs.timebase.flow-software.com/knowledge-base/kb-tickets/new?hsLang=en)

[![FlowEmailHeader](https://docs.timebase.flow-software.com/hs-fs/hubfs/FlowEmailHeader.png?width=120&height=33&name=FlowEmailHeader.png)](https://flow-software.com/)

Open main navigation

Close main navigation

- [More support](https://docs.timebase.flow-software.com/knowledge-base/kb-tickets/new)
- [Open a Support Ticket](https://docs.timebase.flow-software.com/knowledge-base/kb-tickets/new)

[Open a Support Ticket](https://docs.timebase.flow-software.com/knowledge-base/kb-tickets/new?hsLang=en)

 Search all Timebase documentation

- There are no suggestions because the search field is empty.

1. [Timebase Knowledge Base](https://docs.timebase.flow-software.com/knowledge-base?hsLang=en)
2. [Timebase Historian](https://docs.timebase.flow-software.com/knowledge-base/timebase-historian?hsLang=en)

# Subscribe to Live Tag Updates via Web Sockets

## Follow the steps below to subscribe to tags and receive realtime tag updates (last value) via Web Sockets. The example will be using Postman.

1. [**Connect**](https://docs.timebase.flow-software.com/knowledge-base/timebase-real-time-historian-subscribe-to-tag-changes-via-web-sockets#Connect)
2. [**Send Format Message**](https://docs.timebase.flow-software.com/knowledge-base/timebase-real-time-historian-subscribe-to-tag-changes-via-web-sockets#Format)
3. [**Send Subscribe Message**](https://docs.timebase.flow-software.com/knowledge-base/timebase-real-time-historian-subscribe-to-tag-changes-via-web-sockets#Subscribe)
4. [**Send Unsubscribe Message**](https://docs.timebase.flow-software.com/knowledge-base/timebase-real-time-historian-subscribe-to-tag-changes-via-web-sockets#Unsubscribe)

---

The following article will demonstrate how to subscribe to a tag to receive real time tag changes via a web socket connection. Postman will be used to demonstrate / simulate the connection. 

### Connect

In Postman, make a new web socket connection and enter the following address for the Url to connect to.

Url `ws://<yourServerAddressHere>:4511/api/subscribe`

The hub that serves the connection is managed by the Real Time Historian component. Ensure you use the some port as your Historian is configured to utilise. The default port number is 4511. Also, remember to change the \<yourServerAddressHere\> to your respective node address(IP/FQDN) where your Historian is running

Press connect to start the web socket connection.

![](https://docs.timebase.flow-software.com/hs-fs/hubfs/Screenshot%202024-10-08%20at%2023-05-55-png.png?width=670&height=343&name=Screenshot%202024-10-08%20at%2023-05-55-png.png)

### Send "Format" Message

This message must be sent before any others. It informs the Historian Live Streaming Hub of the message protocol and version that will be used.

**Copy the entire payload below, even the empty whitespace character past the `}`.**

```

```

**⚠️ Important**: The Json message is followed by a special character, shown above with the white space placeholder. It will copy and paste correctly.

The ASCII code for this character is 30.

**Make sure to include this charter at the end of your message.**

Paste the message content into the Message box and press the "Send" command

#### ![](https://docs.timebase.flow-software.com/hs-fs/hubfs/Screenshot%202024-10-08%20at%2023-09-34-png.png?width=670&height=472&name=Screenshot%202024-10-08%20at%2023-09-34-png.png)

**⚠️ Important**: **Make sure to include this charter at the end of your message.**

The Json message is followed by a special character, shown above with the white space placeholder. It will copy and paste correctly.

The ASCII code for this character is 30.

### Send "Subscribe" Message

Send a "Subscribe" message to register for live updates of a tag. The message `arguments` are `Dataset` name and `Tagname`:

```

```

Please remember to replace \<Dataset\> with the data set your tag resides in and the \<Tagname\> with the name of the tag you want to subscribe to.

Notice the messages appear for every new tag change value.

### Send "Unsubscribe" Message

If live updates is no longer required, send an "Unsubscribe" message to deregister from live updates. The message `arguments` are `Dataset` name and `Tagname`:

```
{  "arguments": ["<Dataset>", "<Tagname>"],  "target": "Unsubscribe",  "type": 1}
```

Please remember to replace \<Dataset\> with the data set your tag resides in and the \<Tagname\> with the name of the tag you want to subscribe to.

### Pattern Matching Subscriptions (Wildcards)

One can subscribe to multiple tags at once using wildcards. Perfect for monitoring entire systems or groups of sensors.

Use the  `#` character to match **everything** from that point forward. Must be at the end of your pattern.

**Example: Monitor all production line sensors** - Line1/#

Matches everything: `Line1/Conveyor`, `Line1/Conveyor/Speed`, `Line1/Station3/Temp`.

Use `+` to match **exactly one level** in the tag path.

**Example: Monitor all sensors in different rooms **- sensors/+/temperature

Matches: `sensors/room1/temperature`, `sensors/room2/temperature`

Doesn't match: `sensors/room1/lab/temperature` (too many levels)

When unsubscribing, use the exact same patterns as used to subscribe to.

See some common patterns below:

```
sensors/+/temperature          → All temperatures, one level deepproduction/#                   → Everything in productionline+/status                   → Status of line1, line2, line3, etc.building/floor+/room+/temp    → All room temps on all floors
```

 

- [Software Releases](https://docs.timebase.flow-software.com/knowledge-base/software-releases?hsLang=en)
- [Timebase Quick Start](https://docs.timebase.flow-software.com/knowledge-base/timebase-quick-start?hsLang=en#main-content)

    - [Start Here!](https://docs.timebase.flow-software.com/knowledge-base/timebase-quick-start?hsLang=en#start-here)
    - [System Requirements](https://docs.timebase.flow-software.com/knowledge-base/timebase-quick-start?hsLang=en#system-requirements)
    - [Advanced Topics](https://docs.timebase.flow-software.com/knowledge-base/timebase-quick-start?hsLang=en#advanced-topics)
- [Timebase Historian](https://docs.timebase.flow-software.com/knowledge-base/timebase-historian?hsLang=en)
- [Timebase Data Collectors](https://docs.timebase.flow-software.com/knowledge-base/timebase-data-collectors?hsLang=en)
- [Timebase Explorer](https://docs.timebase.flow-software.com/knowledge-base/timebase-explorer?hsLang=en)
- [Timebase Pulse](https://docs.timebase.flow-software.com/knowledge-base/timebase-pulse?hsLang=en)
- [Windows Services Starter](https://docs.timebase.flow-software.com/knowledge-base/windows-services-starter?hsLang=en)

Copyright © 2025, Flow Software