Moonglade

Modern Markdown blogging with AI-powered localization and search.

Tag: Superset


Visualize Caddy logs using Clickhouse

This article introduces how to leverage ClickHouse to build a Caddy log analysis system, enabling efficient data querying and visualization. The author first demonstrates that, after importing Caddy logs into ClickHouse, core metrics such as request volumes per business line, crawler IP identification, independent IP distribution, and CPU consumption can be rapidly aggregated through SQL statements. Additionally, the article details multiple practical query scenarios, including Top 100 popular endpoints, error code rankings, latency trend analysis based on P95/P99 percentiles, request size distribution, time-of-day traffic heatmaps, and User-Agent distribution, helping to gain deep insights into service performance and potential bottlenecks. In practice, the author successfully used this system to track and analyze a hacker's flood attack behavior, quickly locating the source of abnormal traffic through time-window filtering. Finally, the article demonstrates how to generate aesthetically pleasing visual reports using ClickHouse's built-in dashboards and the Grafana tool. The conclusion notes that setting up this infrastructure is of moderate difficulty; once established, it enables real-time monitoring of business metrics. For teams unfamiliar with application usage patterns, visualizing traffic data is an indispensable key method for evaluating business development.

Views 427
Caddy CaddyV2 Clickhouse Docker Python Superset