BigQuery example use

In this example, consider a customer who uses DataStream to ingest logs every five minutes. The customer has received performance complaints over the past few minutes or has some side statistics showing an increase in load times, such as page loads. Here, the customer can quickly make a query to see the load times for all objects or scripts on his page.
You can use BigQuery to get file types together with their download times. This example SQL query returns ts and m3u8 file types:
select d.message.reqPath, CAST(d.netPerf.downloadTime AS INT64) * 1 As dtime FROM `akamai-206503.datastream_logs.edgescapedemo` ,
UNNEST(data) as d
where d.message.reqPath LIKE "%.ts" or d.message.reqPath LIKE "%.m3u8"
order by dTime desc
Here is the result:

You easily point out the files that take longer to download. Then, you can investigate further and make specific queries about the title, allowing the customer to identify the root cause of the problem.

What’s more, Google Data Studio is an integrated feature, making it easy to visualize any query or table in a dashboard or a report. You can use it to convert the table into a graph.


Using an aggregate stream, you can also find out if the numbers of errors have increased. Aggregate data streams retrieve real-time of 4xx and 5xx HTTP error occurrences.

Here is the DataStream Pull API call:
http --auth-type edgegrid -a datastream-pull-api: ":/datastream-pull-api/v1/streams/1201/aggregate-logs?start=2019-02-15T09:19:37Z&end=2019-02-17T10:40:00Z&aggregateMetric=2xx%2C3xx%2C4xx%2C5xx&page=0&size=100"

You can then ingest the return JSON file into BigQuery and visualize the errors in time.