Skip to content

Instantly share code, notes, and snippets.

@lucaswerkmeister
Created December 11, 2016 14:29
Show Gist options
  • Save lucaswerkmeister/c0df15f1aab4a4235e72db145dcadc82 to your computer and use it in GitHub Desktop.
Save lucaswerkmeister/c0df15f1aab4a4235e72db145dcadc82 to your computer and use it in GitHub Desktop.
Days on which Postfix sent most outgoing emails
journalctl -u postfix -o json | jq -r 'select(.MESSAGE | contains("to=")) | .["_SOURCE_REALTIME_TIMESTAMP"]' | awk '{sec=int($1/(1000*1000)); print sec, int(sec/(60*60*24))}' | uniq -f 1 -c | sort -rn | head | while read count stamp day; do printf '%s\t%s\n' "$count" "$(date -Idate -d @$stamp)"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment