ipgrep

command module
v0.0.0-...-42f875d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2016 License: MIT Imports: 9 Imported by: 0

README

ipgrep

usage: ipgrep [file ...]

ipgrep scans one or more input files for valid IPv4 or IPv6 addresses and prints the result. It accepts text files in any format (plaintext, JSON, YAML, etc.) so long as the files contain IPs separated by a delimiter it can recognize (i.e., any whitespace character and any punctuation character other than . or :).

These are all valid inputs:

10.10.10.2 https://webserver.com
{"ip": "172.16.2.84"}
log -> time=13:10, event=foo, addr=192.168.0.2, desc="a foo went bar"
IP address 8.8.8.8 is for Google DNS.

ipgrep would extract 10.10.10.2, 172.16.2.84, 192.168.0.2, and 8.8.8.8 from the above.

Given this input, however —

There’s no place like 127.0.0.1.

ipgrep extracts nothing: Technically, the final . renders that IP invalid, and this utility does not aspire to robustness.

Use standard Golang-fu to install: go get -u github.com/princebot/ipgrep

Documentation

Overview

ipgrep scans one or more input files for valid IPv4 or IPv6 addresses and prints the result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL