---
title: Telegraf Documentation
description: Telegraf plugin for collecting metrics from Network Connection Statistics
url: https://docs.influxdata.com/telegraf/v1/input-plugins/netstat/
estimated_tokens: 753
product: Telegraf
version: v1
---

-   Telegraf v0.2.0+

# Network Connection Statistics Input Plugin

This plugin collects statistics about TCP connection states and UDP socket counts.

**Introduced in:** Telegraf v0.2.0 **Tags:** network **OS support:** all

## Global configuration options

Plugins support additional global and plugin configuration settings for tasks such as modifying metrics, tags, and fields, creating aliases, and configuring plugin ordering. See [CONFIGURATION.md](/telegraf/v1/configuration/#plugins) for more details.

## Configuration

```toml
# Read TCP metrics such as established, time wait and sockets counts.
[[inputs.netstat]]
  # no configuration
```

## Metrics

Supported TCP Connection states are follows.

-   established
-   syn\_sent
-   syn\_recv
-   fin\_wait1
-   fin\_wait2
-   time\_wait
-   close
-   close\_wait
-   last\_ack
-   listen
-   closing
-   none

### TCP Connection State measurements

Meta:

-   units: counts

Measurement names:

-   tcp\_established
-   tcp\_syn\_sent
-   tcp\_syn\_recv
-   tcp\_fin\_wait1
-   tcp\_fin\_wait2
-   tcp\_time\_wait
-   tcp\_close
-   tcp\_close\_wait
-   tcp\_last\_ack
-   tcp\_listen
-   tcp\_closing
-   tcp\_none

If there are no connection on the state, the metric is not counted.

### UDP socket counts measurements

Meta:

-   units: counts

Measurement names:

-   udp\_socket

## Example Output

```text
netstat tcp_close=0i,tcp_close_wait=0i,tcp_closing=0i,tcp_established=14i,tcp_fin_wait1=0i,tcp_fin_wait2=0i,tcp_last_ack=0i,tcp_listen=1i,tcp_none=46i,tcp_syn_recv=0i,tcp_syn_sent=0i,tcp_time_wait=0i,udp_socket=10i 1668520568000000000
```

#### Related

-   [Configure plugins](/telegraf/v1/configure_plugins/)
-   [Network Connection Statistics Plugin Source](https://github.com/influxdata/telegraf/tree/v1.38.4/plugins/inputs/netstat/README.md)
