Opengist Logo 清羽飞扬の代码片段

Explore

  • All gists
  • Topics
  • Users
个人主页 站长博客
Give feedback on the new UI Powered by Opengist ⋅ 13ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login Register
C

CDN

Recently created Least recently created Recently updated Least recently updated
LiuShen

LiuShen / 统计CDN访问日志

Last active 2 months ago CDN log python

通过Python实现访问CDN日志筛选

0 0 1
1 import os
2 import re
3 import csv
4 from collections import defaultdict
5
6 def analyze_logs(log_directory, target_path):
7 """
8 分析日志文件,统计每个IP的总请求数和特定路径的请求数
9
10 :param log_directory: 日志文件夹路径