We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f191a88 commit 95de473Copy full SHA for 95de473
utils/count_apis.sh
@@ -4,11 +4,15 @@
4
5
if [ -z "${1}" ]
6
then
7
- echo "Usage: $0 <path-to-api-logs>"
+ echo "Usage: $0 <path-to-api-logs> [min-count]"
8
echo "Example: $0 api-logs-prod.json"
9
exit 1
10
fi
11
-
+N=10
12
+if [ ! -z "${2}" ]
13
+then
14
+ N="${2}"
15
+fi
16
jq -r '
17
.[].message
18
| capture("LG:api-request-path:(?<p>[^\"[:space:]]+)")? # find the path
@@ -29,4 +33,5 @@ jq -r '
29
33
| sed -E 's#/(00|a0)[A-Za-z0-9]{13,16}(/|$)#/<sfid>\2#g' \
30
34
| sed -E 's#/lf[A-Za-z0-9]{16,22}(/|$)#/<lfxid>\1#g' \
31
35
| sed -E 's#/null(/|$)#/<null>\1#g' \
32
-| sort | uniq -c | sort -nr
36
+| sort | uniq -c | sort -nr \
37
+| awk -v N="$N" '$1 >= N'
0 commit comments