# Stackdriver Monitoring V3 Client - Class LogMatch (2.2.2)

2.2.2 (latest) 2.2.1 2.1.2 2.0.1 1.12.1 1.11.1 1.10.3 1.9.0 1.8.0 1.7.1 1.6.0 1.5.1 1.4.0 1.3.2 1.2.2 Reference documentation and code samples for the Stackdriver Monitoring V3 Client class LogMatch.

A condition type that checks whether a log message in the [scoping
project](https://cloud.google.com/monitoring/api/v3#project_name)
satisfies the given filter. Logs from other projects in the metrics
scope are not evaluated.

Generated from protobuf message `google.monitoring.v3.AlertPolicy.Condition.LogMatch`

## Namespace

Google \\ Cloud \\ Monitoring \\ V3 \\ AlertPolicy \\ Condition

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ filter` | `string` Required. A logs-based filter. See [Advanced Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries) for how this filter should be constructed. |
| `↳ label_extractors` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. A map from a label key to an extractor expression, which is used to extract the value for this label key. Each entry in this map is a specification for how data should be extracted from log entries that match `filter`. Each combination of extracted values is treated as a separate rule for the purposes of triggering notifications. Label keys and corresponding values can be used in notifications generated by this condition. Please see [the documentation on logs-based metric `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor) for syntax and examples. |

### getFilter

Required. A logs-based filter. See [Advanced Logs
Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
for how this filter should be constructed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setFilter

Required. A logs-based filter. See [Advanced Logs
Queries](https://cloud.google.com/logging/docs/view/advanced-queries)
for how this filter should be constructed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLabelExtractors

Optional. A map from a label key to an extractor expression, which is
used to extract the value for this label key. Each entry in this map is
a specification for how data should be extracted from log entries that
match `filter`. Each combination of extracted values is treated as a
separate rule for the purposes of triggering notifications. Label keys
and corresponding values can be used in notifications generated by this
condition.

Please see [the documentation on logs-based metric
`valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
for syntax and examples.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabelExtractors

Optional. A map from a label key to an extractor expression, which is
used to extract the value for this label key. Each entry in this map is
a specification for how data should be extracted from log entries that
match `filter`. Each combination of extracted values is treated as a
separate rule for the purposes of triggering notifications. Label keys
and corresponding values can be used in notifications generated by this
condition.

Please see [the documentation on logs-based metric
`valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
for syntax and examples.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |