[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-05 (世界標準時間)。"],[],[],null,["# Troubleshoot Logging query language\n\nThis document explains common issues that you might encounter when using\nthe Logging query language.\n\n### Syntax issues\n\nIf you have problems with your queries' expressions, check the\nfollowing:\n\n- Your query obeys the syntax rules, with matched parentheses and quotation\n marks.\n\n- Your log entry field names are correctly spelled.\n\n- Boolean operations are in uppercase letters (`AND`, `OR`, `NOT`).\n\n- Ensure that you're using\n [`NULL_VALUE`](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#nullvalue)\n to represent JSON null values.\n\n- Boolean expressions as global restrictions or as the right-hand side of\n comparisons should be parenthesized for clarity. For example, the\n following two queries look the same, but are not:\n\n ```\n insertId = \"ABC-1\" OR \"ABC-2\" -- ERROR!?\n insertId = (\"ABC-1\" OR \"ABC-2\")\n ```\n- Unquoted text must not contain any special characters. When in doubt, add\n double quotation marks. For example, in the following, the first comparison\n is illegal\n because of the embedded substring operator (`:`). The comparison must be\n written with quotation marks:\n\n ```\n insertId = abc:def -- ILLEGAL!\n insertId = \"abc:def\"\n ```\n | **Note:** If you use the search bar and if you don't wrap the search terms in double quotes, then the [`SEARCH` function](/logging/docs/view/logging-query-language#search-functions) is used. The `SEARCH` function performs a search along token boundaries. For example, if you enter `world` in the search bar, then Logging runs the query `SEARCH(\"world\")`. The previous query matches `world` but it doesn't match `worlds`.\n- The [Google Cloud CLI](/logging/docs/reference/tools/gcloud-logging) requires\n the query to be in double quotes. To use double quotes for escaping special\n characters using the `gcloud logging` command, wrap the entire query with\n single quotes instead:\n\n ```\n gcloud logging read 'resource.type=gce_instance AND jsonPayload.message=\"Stopped Unattended Upgrades Shutdown.\"'\n gcloud logging read 'timestamp\u003e=\"2020-06-17T21:00:00Z\"'\n ```\n\n- When you are filtering on a field that is associated with the\n [`Any`](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/any.proto)\n message type, the `value` field is automatically traversed. Therefore,\n don't include `value` in the query.\n\n For example, the\n [`Status`](https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto)\n field in an\n [`AuditLog`](/logging/docs/reference/audit/auditlog/rest/Shared.Types/AuditLog)\n message has a `details` field that is of type `google.protobuf.Any`.\n To query the `details` field, omit the `value` field when specifying the\n filter:\n - Do\n\n ```\n protoPayload.status.details.conditionNotMet.userVisibleMessage =~ \"Specified reservation.*\"\n ```\n - Don't\n\n ```\n protoPayload.status.details.value.conditionNotMet.userVisibleMessage =~ \"Specified reservation.*\"\n ```"]]