【发布时间】:2018-07-20 13:52:46
【问题描述】:
有没有办法将日志从应用引擎加载到 Google Cloud Platform 上的 BigQuery 中?
我正在尝试使用联合查询在 Cloud Storage 中加载 Stackdriver 日志文件。但是 BigQuery 无法加载 Stackdriver 编写的某些字段名称。
日志文件是换行符分隔的 JSON,记录看起来像
{
"insertId":"j594356785jpk",
"labels":{
"appengine.googleapis.com/instance_name":"aef-my-instance-20180204t220251-x59f",
"compute.googleapis.com/resource_id":"99999999999999999",
"compute.googleapis.com/resource_name":"c3453465db",
"compute.googleapis.com/zone":"us-central1-f"
},
"logName":"projects/my-project/logs/appengine.googleapis.com%2Fstdout",
"receiveTimestamp":"2018-02-08T02:59:59.972739505Z",
"resource":{
"labels":{
"module_id":"my-instance",
"project_id":"my-project",
"version_id":"20180204t220251"
},
"type":"gae_app"
},
"textPayload":"{\"json\":\"blob\"}\n",
"timestamp":"2018-02-08T02:59:54Z"
}
但 BigQuery 在此输入上返回错误:query: Invalid field name "compute.googleapis.com/zone". Fields must contain only letters, numbers, and underscores, start with a letter or underscore, and be at most 128 characters long.
有没有办法将这种日志提取到 BigQuery 中?
我对仅提取 textPayload 字段特别感兴趣。
【问题讨论】:
标签: google-app-engine google-cloud-platform google-bigquery etl stackdriver