2

对于 App Engine(Python,标准环境),我在与应用程序相同的项目中创建了一个日志导出 (v2)。接收器的目的地是 Google BigQuery 中的数据集。

我可以在 BigQuery 中执行一些简单的查询:

SELECT
    severity,
    timestamp AS Time,
    protoPayload.host AS Host,
    protoPayload.status AS Status,
    protoPayload.resource AS Path,
    httpRequest.status,
    httpRequest.requestMethod,
    httpRequest.userAgent,
    httpRequest.remoteIp
FROM
    [MY_PROJECT:MYLOGS.appengine_googleapis_com_request_log_20170214]
LIMIT
    10

虽然httpRequest.status将在结果中显示值(并且所有其他选定字段都相同),但其他字段httpRequest显示为null,例如:requestMethoduserAgentremoteIp

在 Cloud Log 网页上,我可以看到这些日志条目并且这些值是存在的,但似乎它们没有导出到 BigQuery。

当我尝试按请求方法过滤时GET,例如:

SELECT
    severity,
    timestamp AS Time,
    protoPayload.host AS Host,
    protoPayload.status AS Status,
    protoPayload.resource AS Path,
    httpRequest.status,
    httpRequest.requestMethod,
    httpRequest.userAgent,
    httpRequest.remoteIp
FROM
    [MY_PROJECT:MYLOGS.appengine_googleapis_com_request_log_20170214]
WHERE
    httpRequest.requestMethod = 'GET'
LIMIT
    10

此查询将返回零记录。

知道吗,为什么某些字段未在查询中显示并且不能用于 BigQuery 中的过滤器?

4

0 回答 0