# HG changeset patch # User Henry S. Thompson # Date 1769183415 0 # Node ID dc784775038477e4de4b9a93f61675da8557beb3 # Parent 783d65d43fb0aea4375ff96928c0a60a5322a458 working on comparing miss key with miss url diff -r 783d65d43fb0 -r dc7847750384 lib/python/cc/lmh/miss_bogons.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/python/cc/lmh/miss_bogons.py Fri Jan 23 15:50:15 2026 +0000 @@ -0,0 +1,23 @@ +#!/usr/bin/python3 +'''Compare the two columns of output from + cdb_one /tmp/hst/%d%d_a/shrunk.cdb 24 25 20230922103943 2>/tmp/hst/2424/cdx-00{}_misses + E.g. + b'4827://188.246.103.10/klubicko/?tab=events' b'10,103,246,188)/klubicko?tab=events' + b'4312://5.160.123.10/' b'10,123,160,5)/' +''' +import sys, re +kPat = re.compile("b'([0-9]*s?://)([^/]*)('$|/(.*)'$)") +kuPat = re.compile("^([^/]*)/?($|([?].*)$)") + +with open(sys.argv[1], 'r') as f: + for l in f: + (key, url) = l.rstrip().split(' ') + if (m:=kPat.match(key)): + (k_d,k_h,_,k_u) = m.groups() + else: + print("bad key |%s|"%key,file=sys.stderr) + exit(1) + #print(key,"|%s|%s|%s|"%(k_d,k_h,k_u)) + print(kuPat.sub('\\1\\2', k_u)) + +