From 6e48bd015c5cea9a46b153ada15463570f3a9b86 Mon Sep 17 00:00:00 2001 From: alyssadev Date: Mon, 18 Sep 2023 15:53:10 +1000 Subject: [PATCH] added tool for querying requests --- tools/check-worker | 20 ++++++++++++++++++++ mimeul => tools/mimeul | 0 2 files changed, 20 insertions(+) create mode 100755 tools/check-worker rename mimeul => tools/mimeul (100%) mode change 100644 => 100755 diff --git a/tools/check-worker b/tools/check-worker new file mode 100755 index 0000000..2019b57 --- /dev/null +++ b/tools/check-worker @@ -0,0 +1,20 @@ +#!/bin/bash +read -r -d '' ASNS <<- EOF + 8075: microsoft (github) +EOF +read -r -d '' SQL <<- EOF + SELECT + index1 as status_code, + blob1 as method, + blob2 as country, + blob3 as asn, + blob4 as timezone, + blob5 as timestamp, + blob6 as ip + FROM METRICS WHERE + timestamp != '' and + ip != '$LOCAL_IP' and + asn != '8075' + ORDER BY timestamp +EOF +curl -X POST "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/analytics_engine/sql" -H "Authorization: Bearer $CF_API_TOKEN" -d "$SQL" 2>/dev/null | jq '["ret", "verb", "xw", "asn", "timezone ", "datetime"], ["---","----","--","---","-------- ","--------"],(.data[] | [if .status_code == "" then "200" else .status_code end, .method, .country, .asn, .timezone, .timestamp]) | @tsv' -r | grep -v '2023-09-18T05:20' diff --git a/mimeul b/tools/mimeul old mode 100644 new mode 100755 similarity index 100% rename from mimeul rename to tools/mimeul