Advertisement
Bazze

Untitled

Oct 16th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.26 KB | None | 0 0
  1. # Convert date in the log file to a unix timestamp
  2. to_unix_date() {
  3.     date=$(awk '{print $4}' | sed "s/\[\([0-9][0-9]\)\/\([A-Z][a-z][a-z]\)\/\([0-9][0-9][0-9][0-9]\):\([0-9][0-9]\):\([0-9][0-9]\):\([0-9][0-9]\)/\1 \2 \3 \4:\5:\6/g")
  4.     date --date="$date" "+%s"
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement