summaryrefslogtreecommitdiffstats
path: root/support/check_forensic
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:01:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:01:30 +0000
commit6beeb1b708550be0d4a53b272283e17e5e35fe17 (patch)
tree1ce8673d4aaa948e5554000101f46536a1e4cc29 /support/check_forensic
parentInitial commit. (diff)
downloadapache2-upstream.tar.xz
apache2-upstream.zip
Adding upstream version 2.4.57.upstream/2.4.57upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'support/check_forensic')
-rwxr-xr-xsupport/check_forensic51
1 files changed, 51 insertions, 0 deletions
diff --git a/support/check_forensic b/support/check_forensic
new file mode 100755
index 0000000..d7a3f78
--- /dev/null
+++ b/support/check_forensic
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# check_forensic <forensic log file>
+
+# check the forensic log for requests that did not complete
+# output the request log for each one
+
+F=$1
+
+temp_create_method=file
+if test -f `which mktemp`; then
+ temp_create_method=mktemp
+elif test -f `which tempfile`; then
+ temp_create_method=tempfile
+fi
+
+create_temp()
+{
+ prefix=$1
+ case "$temp_create_method" in
+ file)
+ name="/tmp/$1.$$"
+ ;;
+ mktemp)
+ name=`mktemp -t $1.XXXXXX`
+ ;;
+ tempfile)
+ name=`tempfile --prefix=$1`
+ ;;
+ *)
+ echo "$0: Cannot create temporary file"
+ exit 1
+ ;;
+ esac
+}
+
+create_temp fcall
+all=$name
+create_temp fcin
+in=$name
+create_temp fcout
+out=$name
+trap "rm -f -- \"$all\" \"$in\" \"$out\";" 0 1 2 3 13 15
+
+cut -f 1 -d '|' $F > $all
+grep ^+ < $all | cut -c2- | sort > $in
+grep -- ^- < $all | cut -c2- | sort > $out
+
+# use -i instead of -I for GNU xargs
+join -v 1 $in $out | xargs -I xx egrep "^\\+xx" $F
+exit 0