cloudflare / cloudflare-gcp

Google Cloud Function to push json files from GC Storage to Big Query
Apache License 2.0
84 stars 49 forks source link

Add Workers Logs Schema #120

Open kylehotchkiss opened 1 year ago

kylehotchkiss commented 1 year ago

This appears to be the default schema for workers events on BigQuery. Can we get this added (I can PR if desired)

[
  {
    "mode": "REPEATED",
    "name": "ScriptTags",
    "type": "STRING"
  },
  {
    "mode": "NULLABLE",
    "name": "ScriptName",
    "type": "STRING"
  },
  {
    "mode": "NULLABLE",
    "name": "Outcome",
    "type": "STRING"
  },
  {
    "mode": "REPEATED",
    "name": "Exceptions",
    "type": "STRING"
  },
  {
    "mode": "NULLABLE",
    "name": "EventType",
    "type": "STRING"
  },
  {
    "mode": "NULLABLE",
    "name": "EventTimestampMs",
    "type": "INTEGER"
  },
  {
    "mode": "REPEATED",
    "name": "Logs",
    "type": "STRING"
  },
  {
    "fields": [
      {
        "fields": [
          {
            "mode": "NULLABLE",
            "name": "Status",
            "type": "INTEGER"
          }
        ],
        "mode": "NULLABLE",
        "name": "Response",
        "type": "RECORD"
      },
      {
        "fields": [
          {
            "mode": "NULLABLE",
            "name": "Method",
            "type": "STRING"
          },
          {
            "mode": "NULLABLE",
            "name": "URL",
            "type": "STRING"
          }
        ],
        "mode": "NULLABLE",
        "name": "Request",
        "type": "RECORD"
      },
      {
        "mode": "NULLABLE",
        "name": "RayID",
        "type": "STRING"
      }
    ],
    "mode": "NULLABLE",
    "name": "Event",
    "type": "RECORD"
  }
]