deploy(ldap): keep the vd03 cutover helpers (otelgrep, sb-cli) for the QA run
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
# usage: python3 otelgrep.py <logs.jsonl pulled from E:\ApiInstall\OtelCollector\data> <service.name regex> <body regex>
|
||||||
|
import json,sys,re
|
||||||
|
svcpat=re.compile(sys.argv[2]); pat=re.compile(sys.argv[3],re.I)
|
||||||
|
for line in open(sys.argv[1]):
|
||||||
|
try: d=json.loads(line)
|
||||||
|
except: continue
|
||||||
|
for rl in d.get('resourceLogs',[]):
|
||||||
|
svc=next((a['value'].get('stringValue') for a in rl['resource'].get('attributes',[]) if a['key']=='service.name'),'?')
|
||||||
|
if not svcpat.search(svc): continue
|
||||||
|
for sl in rl.get('scopeLogs',[]):
|
||||||
|
for r in sl.get('logRecords',[]):
|
||||||
|
body=r.get('body',{}).get('stringValue','')
|
||||||
|
if pat.search(body): print(svc,r.get('timeUnixNano','')[:10],r.get('severityText'),'|',body[:260])
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
# usage: sb-cli.sh <central-url> <args...> e.g. sb-cli.sh http://wonder-app-vq03.zmr.zimmer.com:8085 --username dohertj2 --password-file <f> --format json instance list
|
||||||
|
# Needs the CLI built once: dotnet build ~/Desktop/ScadaBridge/src/ZB.MOM.WW.ScadaBridge.CLI -o ~/.cache/sb-cli
|
||||||
|
url=$1; shift; exec dotnet ~/.cache/sb-cli/scadabridge.dll --url $url "$@"
|
||||||
Reference in New Issue
Block a user