Skip to content

Commit

Permalink
Add IPv4 pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Oct 28, 2023
1 parent df38e63 commit 6e800aa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions diff-logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
r'\b(in|since) \d+\.\d+': 'in 1.1',
# File/download sizes
r'(?i)\d+(?:\.\d+)?(?:/\d)? ?(?P<suffix>kb|kib|mb|mib|gb|gib)': r'1 \g<suffix>',
# HTTP/Headers
r'W/(?P<quote>\\?")[^"]*(?P=quote)': 'W/"ETag"', # ETag header
# TCP / HTTP
r'\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b': '11.1.1.1', # IPv4
r':\d{5,5}\b': ':11111', # Remote port
r'\bW/(?P<quote>\\?")[^"]*(?P=quote)': 'W/"ETag"', # ETag header
# Common files
r'/tmp/[^/:"\']{6,}(?:/[^/:"\']+)*/?': '/tmp/106d1ff',
# Common tools
Expand All @@ -27,7 +29,6 @@
r'(?:[\da-fA-F]{4,}-){4,}[\da-fA-F]{4,}': '106d1ff-106d-1ff1-06d1-ff106d1ff', # UUID
r'[\da-fA-F]{7,}': '106D1FF', # Hash digest
r'[a-zA-Z0-9]{18,}': 'AAAAAAAAAAAAAAAAAA', # Long payload
r':\d{5,5}\b': ':11111', # Remote port
r'━━━━+': '━━━━', # Progress bar
}

Expand Down

0 comments on commit 6e800aa

Please sign in to comment.