Skip to content

Instantly share code, notes, and snippets.

@astrojuanlu
Last active February 17, 2026 16:01
Show Gist options
  • Select an option

  • Save astrojuanlu/540d392a6f1611e1cdbddaa85b9915c9 to your computer and use it in GitHub Desktop.

Select an option

Save astrojuanlu/540d392a6f1611e1cdbddaa85b9915c9 to your computer and use it in GitHub Desktop.
Simple audit log listener for MinIO AIStor Server
$ python3 -u -c "from http.server import BaseHTTPRequestHandler, HTTPServer;
class S(BaseHTTPRequestHandler):
def do_POST(self):
l = int(self.headers['Content-Length'])
print(self.rfile.read(l).decode('utf-8'), flush=True)
self.send_response(200); self.end_headers()
def log_message(self, format, *args): return
HTTPServer(('0.0.0.0', 8099), S).serve_forever()" | tee minio.txt
$ tail -f minio.txt | jq --unbuffered -r '. |
"[\(.time[11:19])] \(.remotehost) | \(.api.name) " +
"-> s3://\(.api.bucket // "")" +
"\(if .api.object then "/" + .api.object else "" end)" +
"\(if .requestQuery.prefix then " (prefix: " + .requestQuery.prefix + ")" else "" end) " +
"| \(.api.status) | \((.userAgent // "unknown") | split(" ")[0])"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment