Skip to content

Instantly share code, notes, and snippets.

@jianingy
Created May 6, 2015 02:26
Show Gist options
  • Save jianingy/859872d85a0aa03f6d65 to your computer and use it in GitHub Desktop.
Save jianingy/859872d85a0aa03f6d65 to your computer and use it in GitHub Desktop.
for access_log in /export/logback/www*/app_m_access.log.2015-04-*.gz; do
(
csv_file="`mktemp $root/tmp/access_log-XXXXXX.csv`"
: > $csv_file
echo "processing $access_log -> $csv_file"
$root/scripts/parse_access_log_v2.py --source xxxxxxxx --access-log $access_log > $csv_file
echo "\COPY m_access_log FROM '$csv_file' WITH CSV" | connect_postgres
rm -f $csv_file
) &
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment