Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit da73108

Browse files
committed
add /logpush/edge/jobs info
1 parent f511729 commit da73108

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,55 @@ $
10981098

10991099
Refer to the Cloudflare Workers API documentation for more information.
11001100

1101+
1102+
## Cloudflare Instant Logs
1103+
1104+
Please see https://developers.cloudflare.com/logs/instant-logs for all the information on how to use this feature.
1105+
The `cli4` command along with the Python libaries can be used to control the instant logs; however, the websocket reading is outside the scope of this library.
1106+
1107+
To query the states of the instant logs:
1108+
```
1109+
$ cli4 /zones/:███████████.com/logpush/edge/jobs | jq .
1110+
[]
1111+
$
1112+
```
1113+
1114+
To add monitoring:
1115+
```
1116+
$ cli4 --post \
1117+
='{
1118+
"fields": "ClientIP,ClientRequestHost,ClientRequestMethod,ClientRequestURI,EdgeEndTimestamp,EdgeResponseBytes,EdgeResponseStatus,EdgeStartTimestamp,RayID",
1119+
"sample": 1,
1120+
"filter": "",
1121+
"kind": "instant-logs"
1122+
}' \
1123+
/zones/:███████████.com/logpush/edge/jobs | jq .
1124+
{
1125+
"destination_conf": "wss://logs.cloudflare.com/instant-logs/ws/sessions/████████████████████████████████",
1126+
"fields": "ClientIP,ClientRequestHost,ClientRequestMethod,ClientRequestURI,EdgeEndTimestamp,EdgeResponseBytes,EdgeResponseStatus,EdgeStartTimestamp,RayID",
1127+
"filter": "",
1128+
"kind": "instant-logs",
1129+
"sample": 1,
1130+
"session_id": "████████████████████████████████"
1131+
}
1132+
$
1133+
```
1134+
1135+
To see the results:
1136+
```
1137+
$ cli4 /zones/:███████████.com/logpush/edge/jobs | jq .
1138+
[
1139+
{
1140+
"fields": "ClientIP,ClientRequestHost,ClientRequestMethod,ClientRequestURI,EdgeEndTimestamp,EdgeResponseBytes,EdgeResponseStatus,EdgeStartTimestamp,RayID",
1141+
"filter": "",
1142+
"kind": "instant-logs",
1143+
"sample": 1,
1144+
"session_id": "████████████████████████████████"
1145+
}
1146+
]
1147+
$
1148+
```
1149+
11011150
## Cloudflare GraphQL
11021151

11031152
The GraphQL interface can be accessed via the command line or via Python.

0 commit comments

Comments
 (0)