LoginSignup
0
0

More than 5 years have passed since last update.

GAEのログをlatencyを条件にしてBigQueryで検索する

Posted at

色々考慮することがある

  • FLATTEN
  • FLOAT
  • REGEXP_REPLACE
  • module

Query

SELECT * FROM 
FLATTEN(
  FLATTEN(
    gaelog_from_bqstreaming.appengine_googleapis_com_request_log_20170318
    , metadata.labels.value
  )
  , protoPayload.line.time
)
WHERE FLOAT(REGEXP_REPLACE(protoPayload.latency, r's', '')) >= 60.0
AND protoPayload.moduleId is null

説明

  • まずnestedなcolumnをflattenにする
  • latencyのclumnがstringで末尾にご丁寧にsがついてるので取り除く
  • stringをfloatに変換
  • default moduleはnullなのでnullを条件にする

いつか役立つだろう

たぶん

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0