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
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
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 valueExtractors for syntax and examples.
getFilter
Required. A logs-based filter. See Advanced Logs
Queries
for how this filter should be constructed.
Returns
Type
Description
string
setFilter
Required. A logs-based filter. See Advanced Logs
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Stackdriver Monitoring V3 Client - Class LogMatch (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-monitoring/latest/V3.AlertPolicy.Condition.LogMatch)\n- [2.1.1](/php/docs/reference/cloud-monitoring/2.1.1/V3.AlertPolicy.Condition.LogMatch)\n- [2.0.1](/php/docs/reference/cloud-monitoring/2.0.1/V3.AlertPolicy.Condition.LogMatch)\n- [1.12.1](/php/docs/reference/cloud-monitoring/1.12.1/V3.AlertPolicy.Condition.LogMatch)\n- [1.11.1](/php/docs/reference/cloud-monitoring/1.11.1/V3.AlertPolicy.Condition.LogMatch)\n- [1.10.3](/php/docs/reference/cloud-monitoring/1.10.3/V3.AlertPolicy.Condition.LogMatch)\n- [1.9.0](/php/docs/reference/cloud-monitoring/1.9.0/V3.AlertPolicy.Condition.LogMatch)\n- [1.8.0](/php/docs/reference/cloud-monitoring/1.8.0/V3.AlertPolicy.Condition.LogMatch)\n- [1.7.1](/php/docs/reference/cloud-monitoring/1.7.1/V3.AlertPolicy.Condition.LogMatch)\n- [1.6.0](/php/docs/reference/cloud-monitoring/1.6.0/V3.AlertPolicy.Condition.LogMatch)\n- [1.5.1](/php/docs/reference/cloud-monitoring/1.5.1/V3.AlertPolicy.Condition.LogMatch)\n- [1.4.0](/php/docs/reference/cloud-monitoring/1.4.0/V3.AlertPolicy.Condition.LogMatch)\n- [1.3.2](/php/docs/reference/cloud-monitoring/1.3.2/V3.AlertPolicy.Condition.LogMatch)\n- [1.2.2](/php/docs/reference/cloud-monitoring/1.2.2/V3.AlertPolicy.Condition.LogMatch) \nReference documentation and code samples for the Stackdriver Monitoring V3 Client class LogMatch.\n\nA condition type that checks whether a log message in the [scoping\nproject](https://cloud.google.com/monitoring/api/v3#project_name)\nsatisfies the given filter. Logs from other projects in the metrics\nscope are not evaluated.\n\nGenerated from protobuf message `google.monitoring.v3.AlertPolicy.Condition.LogMatch`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Monitoring \\\\ V3 \\\\ AlertPolicy \\\\ Condition\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getFilter\n\nRequired. A logs-based filter. See [Advanced Logs\nQueries](https://cloud.google.com/logging/docs/view/advanced-queries)\nfor how this filter should be constructed.\n\n### setFilter\n\nRequired. A logs-based filter. See [Advanced Logs\nQueries](https://cloud.google.com/logging/docs/view/advanced-queries)\nfor how this filter should be constructed.\n\n### getLabelExtractors\n\nOptional. A map from a label key to an extractor expression, which is\nused to extract the value for this label key. Each entry in this map is\na specification for how data should be extracted from log entries that\nmatch `filter`. Each combination of extracted values is treated as a\nseparate rule for the purposes of triggering notifications. Label keys\nand corresponding values can be used in notifications generated by this\ncondition.\n\nPlease see [the documentation on logs-based metric\n`valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)\nfor syntax and examples.\n\n### setLabelExtractors\n\nOptional. A map from a label key to an extractor expression, which is\nused to extract the value for this label key. Each entry in this map is\na specification for how data should be extracted from log entries that\nmatch `filter`. Each combination of extracted values is treated as a\nseparate rule for the purposes of triggering notifications. Label keys\nand corresponding values can be used in notifications generated by this\ncondition.\n\nPlease see [the documentation on logs-based metric\n`valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)\nfor syntax and examples."]]