# Telegraf Socket Listener Plugin: UDP, TCP and Unix Sockets

DevFeed: [Telegraf Socket Listener Plugin: UDP, TCP and Unix Sockets](<https://devfeed.tech/articles/telegraf-socket-listener-plugin-udp-tcp-and-unix-sockets-88341.md>)

Original publisher: [Read original article](<https://www.influxdata.com/blog/telegraf-socket-listener-input-plugin/>)

Author: Noah Crowley (InfluxData)

Published: 2026-10-09T07:00:00Z

Content type: tutorial

Language: en

Sources: [InfluxData](<https://devfeed.tech/sources/influxdata.md>)

Topics: [infrastructure monitoring](<https://devfeed.tech/topics/infrastructure-monitoring.md>), [WebSocket](<https://devfeed.tech/topics/websocket.md>), [Website](<https://devfeed.tech/topics/website.md>), [TCP/IP](<https://devfeed.tech/topics/tcp-ip.md>)

Tags: [developer](<https://devfeed.tech/tags/developer.md>), [influxdb](<https://devfeed.tech/tags/influxdb.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [product](<https://devfeed.tech/tags/product.md>), [tcp](<https://devfeed.tech/tags/tcp.md>), [udp](<https://devfeed.tech/tags/udp.md>), [unix](<https://devfeed.tech/tags/unix.md>), [use-cases](<https://devfeed.tech/tags/use-cases.md>)

## AI overview

The article shows how to use Telegraf's socket_listener input plugin to send data into Telegraf and InfluxDB over UDP and Unix sockets. It explains UDP's delivery and overhead tradeoffs, configures a UDP listener on port 8094, and demonstrates sending and verifying points. It then shows a Python script that writes random walk data through a Unix datagram socket, noting that Unix sockets can reduce local communication overhead.

## Source excerpt

One of Telegraf's biggest strengths is the large collection of plugins it offers that can be used to immediately start collecting data from a variety of applications. This covers a lot of common infrastructure components like databases and web servers, but if you want to get data into Telegraf using your own scripts or applications, there are also a variety of more general-purpose input plugins that you can use. There's a file plugin, which will read from or tail a file on disk, an exec plugin which will execute your own scripts or commands and parse their output, and plugins to listen for data via HTTP or poll external endpoints (http_listener_v2 and http). One of the plugins I end up using most often is the socket_listener plugin, which allows you to send data to Telegraf using UDP, TCP, or Unix sockets. The simplicity of InfluxDB's line protocol and the ease with which you can write to a socket using most programming languages makes this a powerful tool for both quick prototyping and more long-term solutions. Let's take a look at some examples of the plugin in action. We'll use a host system running Ubuntu, with Telegraf and InfluxDB installed from the official InfluxData repository. UDP: User Datagram Protocol For this first example, let's configure the socket_listener plugin to accept UDP packets. The UDP protocol is a connectionless, best-effort service: messages are sent to their recipient with no guarantee that they will be received. One benefit of this is that it means there is less processing overhead for UDP relative to something like TCP, which is more reliable. That makes UDP well-suited for things like interprocess communication or situations in which some loss of data is acceptable. In order to set up Telegraf to receive UDP messages, first configure this block in your telegraf.conf: [[inputs.socket_listener]] service_address = "udp://:8094" data_format = "influx" This configures Telegraf to listen for data on UDP port 8094 in InfluxDB line protocol f