Always get this spark in my mind whenever I read something interesting, but forget it when a new idea enters. This Blog is an attempt to plot those ideas so that I can go through later. Wishing me Luck!
zgrep "text" /var/log/nginx/access.log | awk '{print $6}' | sed -e 's/\"/\ /g' | awk -F'[:/]' '{ # Build a new date string that GNU date can understand timestamp = $1 " " $2 " " $3 " " $4 ":" $5 ":" $6 cmd = "TZ=\"America/Los_Angeles\" date -d \"" timestamp " UTC\" \"+%Y-%m-%d %H:%M:%S %Z\"" cmd | getline converted close(cmd) print converted }'
Comments
Post a Comment