---
title: "sampling | Grafana Enterprise Logs documentation"
description: "The 'sampling' Promtail pipeline stage."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# sampling

> Caution
> 
> Promtail has been deprecated and is in Long-Term Support (LTS) through February 28, 2026. Promtail will reach an End-of-Life (EOL) on March 2, 2026. You can find migration resources [here](/docs/alloy/latest/set-up/migrate/from-promtail/).

The `sampling` stage is a stage that sampling logs.

## Sampling stage schema

The `sampling` stage is used to sampling the logs. Configuring the value `rate: 0.1` means that 10% of the logs will be pushed to the Loki server.

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
sampling:
  # The rate sampling in lines per second that Promtail will push to Loki.The value is between 0 and 1, where a value of 0 means no logs are sampled and a value of 1 means 100% of logs are sampled.
  [rate: <int>]  
```

## Examples

The following are examples showing the use of the `sampling` stage.

### sampling

#### Simple sampling

Given the pipeline:

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
- sampling:
    rate: 0.1
```

#### Match a line and sampling

Given the pipeline:

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
pipeline_stages:
- json:
    expressions:
      app:
- match:
    pipeline_name: "app2"
    selector: '{app="poki"}'
    stages:
    - sampling:
        rate: 0.1
```

Complex `sampling` stage configurations.
