Skip to content

Instantly share code, notes, and snippets.

@thomashartm
Created June 5, 2019 06:37
Show Gist options
  • Save thomashartm/02bb14add810213daac43a89a05ff0fc to your computer and use it in GitHub Desktop.
Save thomashartm/02bb14add810213daac43a89a05ff0fc to your computer and use it in GitHub Desktop.
Searches for an IP in archived and gzipped log files and splits by whitespace and shows the first 3 elements
#!/bin/bash
zgrep -e "127.0.0.1" archive/access.log* | grep ".html" | cut -d' ' -f1,3,2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment