﻿---
title: Label matching operators
description: PromQL label matching operators in Elasticsearch.
url: https://docs-v3-preview.elastic.dev/elastic/elasticsearch/tree/main/reference/query-languages/promql/operators/label-matching
products:
  - Elasticsearch
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Preview in 9.4
---

# Label matching operators
These operators are used inside instant vector selectors (`{...}`) to match series by label.

## `=` (label_eq)

<applies-to>Elastic Stack: Preview in 9.4</applies-to>
Matches labels exactly equal to the provided string.
**Operands**
<definitions>
  <definition term="label (string)">
    The label name to match on, used inside a selector (`{...}`).
  </definition>
  <definition term="value (string)">
    The string or regular expression to compare the label value against.
  </definition>
</definitions>

**Returns**
Used inside an instant vector selector (`{...}`) to select an `instant_vector`, rather than as a standalone expression.
**Example**
```
requests_total{method="GET"}
```


## `!=` (label_neq)

<applies-to>Elastic Stack: Preview in 9.4</applies-to>
Matches labels not equal to the provided string.
**Operands**
<definitions>
  <definition term="label (string)">
    The label name to match on, used inside a selector (`{...}`).
  </definition>
  <definition term="value (string)">
    The string or regular expression to compare the label value against.
  </definition>
</definitions>

**Returns**
Used inside an instant vector selector (`{...}`) to select an `instant_vector`, rather than as a standalone expression.
**Example**
```
requests_total{method!="DELETE"}
```


## `!~` (label_nre)

<applies-to>Elastic Stack: Preview in 9.4</applies-to>
Matches labels whose value does not satisfy the provided regular expression.
**Operands**
<definitions>
  <definition term="label (string)">
    The label name to match on, used inside a selector (`{...}`).
  </definition>
  <definition term="value (string)">
    The string or regular expression to compare the label value against.
  </definition>
</definitions>

**Returns**
Used inside an instant vector selector (`{...}`) to select an `instant_vector`, rather than as a standalone expression.
**Example**
```
requests_total{method!~"DELETE|PUT"}
```


## `=~` (label_re)

<applies-to>Elastic Stack: Preview in 9.4</applies-to>
Matches labels whose value satisfies the provided regular expression.
**Operands**
<definitions>
  <definition term="label (string)">
    The label name to match on, used inside a selector (`{...}`).
  </definition>
  <definition term="value (string)">
    The string or regular expression to compare the label value against.
  </definition>
</definitions>

**Returns**
Used inside an instant vector selector (`{...}`) to select an `instant_vector`, rather than as a standalone expression.
**Example**
```
requests_total{method=~"GET|POST"}
```