ipgrep

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 9 Imported by: 0

README

ipgrep

IPv4/IPv6 CIDR netmask aware file pattern searcher. Searches lines from log files by IP address or CIDR mask. Can also match an IP address search term against firewall configuration with netmasks.

$ ipgrep 4.3.2.1 example.conf
allow all from 4.3.2.1m255.255.255.0
deny from 4.3.2.1m31

Go

Supported formats:

  • 1.2.3.4 (plain IPv4)
  • 1.2.3.4/24 (IPv4 CIDR)
  • 1.2.3.4m24 (IPv4 m notation)
  • 1.2.3.4m255.255.255.0 (IPv4 m mask)
  • 2001:db8::1 (plain IPv6)
  • 2001:db8::1/64 (IPv6 CIDR)

Installing

$ go get github.com/joneskoo/ipgrep/...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Grep

func Grep(r io.Reader, w io.Writer, search string) error

Grep finds IP addresses matching pattern in Reader and writes matching to Writer

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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