Add log-anomaly module: Spring Boot log parser, template mining, swappable embedder, k-means baseline, novel-template and rate-spike detectors with measured blind spots, incidents and a template-only summary prompt on Spring Boot 4.2.0
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b69H5rTewUKPyhGS8r
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# Regenerates every file in output/: the tests write 01-12, the packaged jar plus curl writes 13.
|
||||
# Timestamps, PIDs and timings in 12 and 13 differ on every run; the numbers in 01-11 do not.
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
mvn -B -q -f ../pom.xml -pl log-anomaly package
|
||||
java -cp target/classes com.ankurm.logs.SampleLogWriter target/sample-logs
|
||||
{
|
||||
echo "# The packaged jar answering curl"
|
||||
echo '$ java -jar target/log-anomaly.jar --server.port=18080 &'
|
||||
java -jar target/log-anomaly.jar --server.port=18080 --spring.main.banner-mode=off > target/jar.log 2>&1 &
|
||||
PID=$!
|
||||
trap 'kill $PID 2>/dev/null || true' EXIT
|
||||
for i in $(seq 1 60); do curl -s -o /dev/null "localhost:18080/api/incidents" && break; sleep 1; done
|
||||
echo '$ curl -s "localhost:18080/api/incidents?baseline=target/sample-logs/baseline.log&target=target/sample-logs/target.log"'
|
||||
curl -s "localhost:18080/api/incidents?baseline=target/sample-logs/baseline.log&target=target/sample-logs/target.log" \
|
||||
| python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps({k:d[k] for k in ("baselineLines","targetLines","baselineTemplates","targetTemplates","clusters")}, indent=2)); print(d["summaries"][0])'
|
||||
echo
|
||||
echo '$ curl -s -o /dev/null -w "%{http_code}" "localhost:18080/api/incidents?baseline=missing.log&target=missing.log"'
|
||||
curl -s -o /dev/null -w "%{http_code}\n" "localhost:18080/api/incidents?baseline=missing.log&target=missing.log"
|
||||
} > output/13-jar-curl.txt
|
||||
echo "wrote output/13-jar-curl.txt"
|
||||
Reference in New Issue
Block a user