---
title: ''
description: Telegraf plugin for collecting metrics from Slab
url: https://docs.influxdata.com/telegraf/v1/input-plugins/slab/
estimated_tokens: 568
product: Telegraf Enterprise
version: v1
publisher: InfluxData
canonical: https://docs.influxdata.com/telegraf/v1/input-plugins/slab/
date: '2026-05-21T20:10:18+02:00'
lastmod: '2026-05-21T20:10:18+02:00'
---

==========

* Telegraf v1.23.0+

[Plugin source](https://github.com/influxdata/telegraf/tree/v1.39.1/plugins/inputs/slab/)[Download configuration](https://raw.githubusercontent.com/influxdata/telegraf/refs/tags/v1.39.1/plugins/inputs/slab/sample.conf)

# Slab Input Plugin

This plugin collects details on memory consumption of [Slab cache](https://www.kernel.org/doc/gorman/html/understand/understand011.html) entries
by parsing the `/proc/slabinfo` file respecting the `HOST_PROC` environment
variable.

> [!Note]
> This plugin requires `/proc/slabinfo` to be readable by the Telegraf user.

**Introduced in:** Telegraf v1.23.0**Tags:** system**OS support:** linux

## 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
# Get slab statistics from procfs
# This plugin ONLY supports Linux
[[inputs.slab]]
  # no configuration - please see the plugin's README for steps to configure
  # sudo properly
```

### Sudo configuration

Since the slabinfo file is only readable by root, the plugin runs`sudo /bin/cat` to read the file.

Sudo can be configured to allow telegraf to run just the command needed to read
the slabinfo file. For example, if telegraf is running as the user `telegraf`and `HOST_PROC` is not used, add this to the sudoers file

```text
telegraf ALL = (root) NOPASSWD: /bin/cat /proc/slabinfo
```

## Metrics

Metrics include generic ones such as `kmalloc_*` as well as those of kernel
subsystems and drivers used by the system such as `xfs_inode`.
Each field with `_size` suffix indicates memory consumption in bytes.

* mem
  * tags:
  * fields:
    * kmalloc\_8\_size (integer)
    * kmalloc\_16\_size (integer)
    * kmalloc\_32\_size (integer)
    * kmalloc\_64\_size (integer)
    * kmalloc\_96\_size (integer)
    * kmalloc\_128\_size (integer)
    * kmalloc\_256\_size (integer)
    * kmalloc\_512\_size (integer)
    * xfs\_ili\_size (integer)
    * xfs\_inode\_size (integer)

## Example Output

```text
slab kmalloc_1024_size=239927296i,kmalloc_512_size=5582848i 1651049129000000000
```
