---
title: promql.labelReplace() function
description: promql.labelReplace() implements functionality equivalent to PromQL’s label_replace() function.
url: https://docs.influxdata.com/flux/v0/stdlib/internal/promql/labelreplace/
estimated_tokens: 699
product: Flux
version: v0
---

# promql.labelReplace() function

-   Flux 0.47.0+
-   View InfluxDB support

`promql.labelReplace()` implements functionality equivalent to [PromQL’s `label_replace()` function](https://prometheus.io/docs/prometheus/latest/querying/functions/#label_replace).

**Important**: The `internal/promql` package is not meant for external use.

##### Function type signature

```js
(
    <-tables: stream[{A with _value: float}],
    destination: string,
    regex: string,
    replacement: string,
    source: string,
) => stream[{B with _value: float}]
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### tables

Input data. Default is piped-forward data (`<-`).

### source

(Required) Input label.

### destination

(Required) Output label.

### regex

(Required) Pattern as a regex string.

### replacement

(Required) Replacement value.
