MCPcopy Index your code
hub / github.com/idank/explainshell / gen_log_processing_cmd

Function gen_log_processing_cmd

tools/loadtest.py:104–118  ·  view source on GitHub ↗

geoip / failedcomments pipeline (observed in misc bot traffic).

(rng: random.Random)

Source from the content-addressed store, hash-verified

102
103
104def gen_log_processing_cmd(rng: random.Random) -> str:
105 """geoip / failedcomments pipeline (observed in misc bot traffic)."""
106 c1 = _pick(CAT_VARIANTS + READ_VARIANTS, rng)
107 aw = _pick(AWK_VARIANTS, rng)
108 xa = _pick(XARGS_VARIANTS, rng)
109 se = _pick(SED_VARIANTS, rng)
110 s1, s2 = _pick(SORT_VARIANTS, rng), _pick(SORT_VARIANTS, rng)
111 un = _pick(UNIQ_VARIANTS, rng)
112 return (
113 f"{c1} failedcomments.log | "
114 f'{aw} \'BEGIN {{ FS="|" }} {{ gsub(" ip: ", "", $2); print $2 }}\' | '
115 f"{xa} -n1 geoiplookup | "
116 f"{se} -e 's/GeoIP Country Edition: //' | "
117 f"{s1} | {un} -c | {s2} -rn"
118 )
119
120
121def gen_perl_cleanup_cmd(rng: random.Random) -> str:

Callers

nothing calls this directly

Calls 1

_pickFunction · 0.85

Tested by

no test coverage detected