Reference documentation and code samples for the Stackdriver Monitoring V3 Client class SqlCondition.
A condition that allows alerting policies to be defined using GoogleSQL.
SQL conditions examine a sliding window of logs using GoogleSQL. Alert policies with SQL conditions may incur additional billing.
Generated from protobuf message google.monitoring.v3.AlertPolicy.Condition.SqlCondition
Namespace
Google \ Cloud \ Monitoring \ V3 \ AlertPolicy \ ConditionMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ query |
string
Required. The Log Analytics SQL query to run, as a string. The query must conform to the required shape. Specifically, the query must not try to filter the input by time. A filter will automatically be applied to filter the input so that the query receives all rows received since the last time the query was run. For example, the following query extracts all log entries containing an HTTP request: SELECT timestamp, log_name, severity, http_request, resource, labels FROM my-project.global._Default._AllLogs WHERE http_request IS NOT NULL |
↳ minutes |
SqlCondition\Minutes
Schedule the query to execute every so many minutes. |
↳ hourly |
SqlCondition\Hourly
Schedule the query to execute every so many hours. |
↳ daily |
SqlCondition\Daily
Schedule the query to execute every so many days. |
↳ row_count_test |
SqlCondition\RowCountTest
Test the row count against a threshold. |
↳ boolean_test |
SqlCondition\BooleanTest
Test the boolean value in the indicated column. |
getQuery
Required. The Log Analytics SQL query to run, as a string. The query must conform to the required shape. Specifically, the query must not try to filter the input by time. A filter will automatically be applied to filter the input so that the query receives all rows received since the last time the query was run.
For example, the following query extracts all log entries containing an HTTP request: SELECT timestamp, log_name, severity, http_request, resource, labels FROM my-project.global._Default._AllLogs WHERE http_request IS NOT NULL
Returns | |
---|---|
Type | Description |
string |
setQuery
Required. The Log Analytics SQL query to run, as a string. The query must conform to the required shape. Specifically, the query must not try to filter the input by time. A filter will automatically be applied to filter the input so that the query receives all rows received since the last time the query was run.
For example, the following query extracts all log entries containing an HTTP request: SELECT timestamp, log_name, severity, http_request, resource, labels FROM my-project.global._Default._AllLogs WHERE http_request IS NOT NULL
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getMinutes
Schedule the query to execute every so many minutes.
Returns | |
---|---|
Type | Description |
SqlCondition\Minutes|null |
hasMinutes
setMinutes
Schedule the query to execute every so many minutes.
Parameter | |
---|---|
Name | Description |
var |
SqlCondition\Minutes
|
Returns | |
---|---|
Type | Description |
$this |
getHourly
Schedule the query to execute every so many hours.
Returns | |
---|---|
Type | Description |
SqlCondition\Hourly|null |
hasHourly
setHourly
Schedule the query to execute every so many hours.
Parameter | |
---|---|
Name | Description |
var |
SqlCondition\Hourly
|
Returns | |
---|---|
Type | Description |
$this |
getDaily
Schedule the query to execute every so many days.
Returns | |
---|---|
Type | Description |
SqlCondition\Daily|null |
hasDaily
setDaily
Schedule the query to execute every so many days.
Parameter | |
---|---|
Name | Description |
var |
SqlCondition\Daily
|
Returns | |
---|---|
Type | Description |
$this |
getRowCountTest
Test the row count against a threshold.
Returns | |
---|---|
Type | Description |
SqlCondition\RowCountTest|null |
hasRowCountTest
setRowCountTest
Test the row count against a threshold.
Parameter | |
---|---|
Name | Description |
var |
SqlCondition\RowCountTest
|
Returns | |
---|---|
Type | Description |
$this |
getBooleanTest
Test the boolean value in the indicated column.
Returns | |
---|---|
Type | Description |
SqlCondition\BooleanTest|null |
hasBooleanTest
setBooleanTest
Test the boolean value in the indicated column.
Parameter | |
---|---|
Name | Description |
var |
SqlCondition\BooleanTest
|
Returns | |
---|---|
Type | Description |
$this |
getSchedule
Returns | |
---|---|
Type | Description |
string |
getEvaluate
Returns | |
---|---|
Type | Description |
string |