Skip to content

Commit e9e0c65

Browse files
committed
Implemented David's feedback
1 parent 4a989e9 commit e9e0c65

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/content/docs/log-explorer/example-queries.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ SELECT
2222
SUM(EdgeResponseBytes) / (1024.0 * 1024.0) AS total_data_transfer_mb
2323
FROM
2424
http_requests
25-
WHERE
26-
EdgeEndTimestamp >= '2026-02-01T00:00:00Z'
27-
AND EdgeEndTimestamp <= '2026-02-08T23:59:59Z'
25+
WHERE {{ timeFilter }}
2826
```
2927

3028
## Review distribution of security actions
@@ -50,13 +48,22 @@ Identify the top client IP addresses and request URIs that triggered managed, Ja
5048
SELECT
5149
ClientIP,
5250
ClientRequestURI,
53-
SecurityAction,
51+
SecurityActions,
5452
COUNT(*) AS Count
5553
FROM http_requests
56-
WHERE SecurityAction IN ('managed_challenge', 'jschallenge', 'challenge')
57-
GROUP BY ClientIP, ClientRequestURI, SecurityAction
54+
WHERE {{ timeFilter }}
55+
AND (
56+
ARRAY_CONTAINS(SecurityActions, 'challenge')
57+
OR ARRAY_CONTAINS(SecurityActions, 'managedChallenge')
58+
OR ARRAY_CONTAINS(SecurityActions, 'jsChallenge')
59+
OR ARRAY_CONTAINS(SecurityActions, 'challengeSolved')
60+
)
61+
GROUP BY
62+
ClientIP,
63+
ClientRequestURI,
64+
SecurityActions
5865
ORDER BY Count DESC
59-
LIMIT 10
66+
LIMIT 20
6067
```
6168

6269
## Find highest bandwidth consumers by URI
@@ -68,6 +75,7 @@ SELECT
6875
ClientRequestURI,
6976
SUM(EdgeResponseBytes) / (1024 * 1024) AS MegabytesTransferred
7077
FROM http_requests
78+
WHERE {{ timeFilter }}
7179
GROUP BY ClientRequestURI
7280
ORDER BY MegabytesTransferred DESC
7381
LIMIT 10
@@ -85,10 +93,7 @@ SELECT
8593
MIN(ClientTCPRttMs) AS min_rtt,
8694
MAX(ClientTCPRttMs) AS max_rtt
8795
FROM http_requests
88-
WHERE date = '2026-03-04'
89-
AND EdgeEndTimestamp >= '2026-03-04T00:00:00Z'
90-
AND EdgeEndTimestamp <= '2026-03-04T23:59:59Z'
91-
AND ClientTCPRttMs > 0
96+
WHERE {{ timeFilter }}
9297
GROUP BY ClientCountry
9398
ORDER BY avg_rtt DESC
9499
LIMIT 20
@@ -105,9 +110,7 @@ SELECT
105110
SUM(EdgeResponseBytes) AS total_bytes,
106111
AVG(EdgeTimeToFirstByteMs) AS avg_ttfb
107112
FROM http_requests
108-
WHERE date = '2026-03-04'
109-
AND EdgeEndTimestamp >= '2026-03-04T00:00:00Z'
110-
AND EdgeEndTimestamp <= '2026-03-04T23:59:59Z'
113+
WHERE {{ timeFilter }}
111114
GROUP BY CacheCacheStatus
112115
ORDER BY requests DESC
113116
```
@@ -123,10 +126,7 @@ SELECT
123126
COUNT(*) AS requests,
124127
SUM(CASE WHEN EdgeResponseStatus >= 500 THEN 1 ELSE 0 END) AS errors
125128
FROM http_requests
126-
WHERE date = '2026-03-04'
127-
AND EdgeEndTimestamp >= '2026-03-04T00:00:00Z'
128-
AND EdgeEndTimestamp <= '2026-03-04T23:59:59Z'
129-
GROUP BY ClientRequestPath
129+
WHERE {{ timeFilter }}
130130
ORDER BY avg_ttfb DESC
131131
LIMIT 10
132132
```

0 commit comments

Comments
 (0)