Skip to content

Instantly share code, notes, and snippets.

@ktmud
Last active December 19, 2015 09:28
Show Gist options
  • Save ktmud/5932773 to your computer and use it in GitHub Desktop.
Save ktmud/5932773 to your computer and use it in GitHub Desktop.
log formatting
#!/bin/bash
logfiles="/mfs/log/scribe/xxxxx/*/*_current"
TAB="$(printf '\t')"
for f in $logfiles; do
while IFS=$TAB; read -r SITE USER_ID CONTENT EXTRA UA COOKIE; do
echo "[$SITE] $USER_ID"
echo "-----------------"
echo -e "$CONTENT"
echo "-----------------"
echo -e $EXTRA
echo "user_agent: $UA"
echo "cookie: $COOKIE"
echo ''
done < $f
done
group 123456 很讨厌现在的网页版。麻烦的要死。越搞越麻烦。都不想用了。烦人。 ratio: 2\ninner: 320x416\nscreen: 320x480\navail: 320x460\navailPos: 0, 0\np_last: http://xxxxxx/gxxxxx/\np_cur: http://xxxxxxxx/gxxxxxxx/\nserver: haha Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B208 Safari/7534.48.3 __utma=30149280.878018118.1360263182.1371740025.1372821770.141; __utmv=30149280.3722; __utmz=30149280.1360263182.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment