> ## Documentation Index
> Fetch the complete documentation index at: https://docs.honeycomb.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Log Sampling

<Badge className="hny-badge-enterprise-addon" stroke>Ent+</Badge>

<Note>
  This feature is available as an add-on for the [Honeycomb Enterprise plan](https://www.honeycomb.io/pricing/).
  Please contact your Honeycomb account team for details.
</Note>

## Description

The Log Sampling processor can be used to filter out logs with a configured "drop ratio".

## Supported Types

| Metrics | Logs | Traces |
| :------ | :--- | :----- |
|         | ✓    |        |

## Configuration Table

| Parameter   | Type   | Default  | Description                                                                                                                                                            |
| :---------- | :----- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| drop\_ratio | `enum` | `"0.50"` | The probability an entry is dropped (used for sampling). A value of 1.0 will drop 100% of matching entries, while a value of 0.0 will drop 0%.                         |
| condition   | string | `true`   | An [OTTL] expression used to match which log records to sample from. All paths in the [log context] are available to reference. All [converters] are available to use. |

[OTTL]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.109.0/pkg/ottl#readme

[converters]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.109.0/pkg/ottl/ottlfuncs/README.md#converters

[log context]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.109.0/pkg/ottl/contexts/ottllog/README.md

<Note>
  Use of the `condition` parameter requires HTP Agent `v1.61.0` or above.
</Note>

Value drop ratio's range from "0.0" (0%) to "1.00" (100%) with 5% increments. Note that the drop ratio value is a string.

## Example Configuration

Filter out 75% of logs where Attribute "ID" == 1.

### Web Interface

<img src="https://mintcdn.com/honeycomb/FNYuq-2hLi3yC7Fz/_assets/images/htp/xnapper-sample-logs.png?fit=max&auto=format&n=FNYuq-2hLi3yC7Fz&q=85&s=3e35a965743a46a06c3c199810373e85" alt="Honeycomb Docs - Log Sampling - image 1" width="3198" height="3522" data-path="_assets/images/htp/xnapper-sample-logs.png" />

### Standalone Processor

```yaml theme={}
apiVersion: bindplane.observiq.com/v1
kind: Processor
metadata:
  id: sampling
  name: sampling
spec:
  type: sampling
  parameters:
    - name: drop_ratio
      value: '0.75'
    - name: condition
      value: '(attributes["ID"] == 1)'
```
