10x Log Analysis Efficiency: Extract All IP Addresses from Text in One Click (Supports IPv4/IPv6)
"Xiao Wang, help me organize the IPs from these logs, deduplicate them, and send them to me. Oh, and only external IPs, IPv6 too."
Hearing this, is your heart crumbling?
Facing messy log files, configuration files, or even text mixed with code, accurately extracting all IP addresses is not an easy task.
Why is manual extraction so difficult?
1. Various Formats
IPs in logs might look like this:
192.168.1.1(Standard)[2001:db8::1]:8080(With port)IP="10.0.0.1";(In code or config){"ip": "192.168.1.1"}(JSON format)
Simple regular expressions often fail due to punctuation interference, such as misidentifying 1.1.1.1. (ending with a period) or missing complex IPv6 addresses.
2. IPv6 is a Nightmare
If extracting IPv4 is barely manageable with regex, extracting IPv6 is simply anti-human.
Try writing a regex that matches 2001:0db8:85a3:0000:0000:8a2e:0370:7334 and its shorthand ::1? I think you'll give up.
3. Secondary Cleaning Required
Extraction is not enough; you usually also need:
- Deduplication: If the same IP appears 1000 times, I only want it once.
- Cleaning: Remove trailing periods and commas, and remove port numbers.
Stop writing Python scripts, use this!
To solve this problem, I upgraded the Log IP Analyzer (formerly IP Range Matcher). It's no longer just a matcher, but an intelligent extractor that understands network protocols.
Core Features:
🚀 Smart Extraction Mode
Now, you just need to paste the text, without entering any target IP, and the tool will automatically enter extraction mode.
Whether you paste Nginx Logs, JSON, YAML, or messy HTML source code, as long as there are IPs inside, it can pull them out for you.
- Smart Tokenization: Automatically handles cases like
IP:1.1.1.1orfe80::1.where punctuation is close, accurately restoring pure IPs. - Dual-Stack Support: Perfectly supports IPv4 and IPv6 CIDR.
- Automatic Deduplication: Extraction results are automatically deduplicated, no manual processing required.
📋 One-Click Copy
Extracted 500 IPs? No need to select all manually.
Click the "Copy All" button in the upper right corner to put the cleaned IP list directly into your clipboard, making it easy to paste into Excel or firewall configurations.
🎯 Range Matching
This is an advanced usage of the tool.
If you enter an IP in the Target IP field (e.g., 10.0.0.1), the tool instantly transforms into a "radar":
It scans the entire text and only highlights the subnet rules that contain that target IP. This is a killer feature when troubleshooting routing tables or firewall rules.
Typical Usage Scenarios
- Fishing for IPs from logs: Directly paste
access.logsnippets and extract all visitor IPs with one click. - Organizing Cloud Provider IP Lists: Paste long IP range JSON from AWS or Cloudflare and instantly extract all subnets.
- Code Auditing: Quickly scan source code for hardcoded IP addresses.
Save the time spent writing regex and debugging scripts, and go grab a cup of coffee.
Efficiency is life. Visit this website to unlock more developer tools that let you get off work early.