Skip to content

Instantly share code, notes, and snippets.

@colemanjp
Created October 12, 2013 02:36
Show Gist options
  • Select an option

  • Save colemanjp/6945079 to your computer and use it in GitHub Desktop.

Select an option

Save colemanjp/6945079 to your computer and use it in GitHub Desktop.
awk -F, '/authid=/{print $3}' maillog | sort | uniq -c | sort -rn > sorted
Timestamps with a counter
awk -F, '/authid=aaa/{print $1 $3}' maillog maillog.1 | awk '++a { print $3 " " a}'
Connections per hour displayed
awk -F, '/authid=aaa/{print $1 $3}' maillog | awk '{ print $3}' | awk -F: '{print $1":00"}' | uniq -c
Connections per minute displayed
awk -F, '/authid=aaa/{print $1 $3}' maillog | awk '{ print $3}' | awk -F: '{print $1":"$2}' | uniq -c
Connections per second displayed
awk -F, '/authid=aaa/{print $1 $3}' maillog | awk '{ print $3}' | awk -F: '{print $1":"$2":"$3}' | uniq -c
Append | awk '{print $2" "$1}' | sort to flip the time and the count for plotting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment