# UDP

The [User Datagram Protocol (UDP)](https://en.wikipedia.org/wiki/User_Datagram_Protocol) is a connection-less protocol to send messages on an IP network. Tenzir supports writing to and reading from UDP sockets, both in server (listening) and client (connect) mode.

Use the IP address `0.0.0.0` to listen on all available network interfaces.

## Examples

Use [`accept_udp`](https://preview.docs.tenzir.com/375/375/reference/operators/accept_udp.md) to receive UDP datagrams as structured events containing message data and peer information. Use [`to_udp`](https://preview.docs.tenzir.com/375/375/reference/operators/to_udp.md) to send one UDP datagram per event directly from structured data.

### Receive syslog messages over UDP

```tql
accept_udp "0.0.0.0:514"
this = data.parse_syslog()
```

### Send events to a UDP socket

```tql
from {message: "Tenzir"}
to_udp "1.2.3.4:8080", message=message
```