Skip to content

Instantly share code, notes, and snippets.

@nikkisharma536
Created January 14, 2019 09:33
Show Gist options
  • Select an option

  • Save nikkisharma536/18e863a32251a1f696b49ca151308fda to your computer and use it in GitHub Desktop.

Select an option

Save nikkisharma536/18e863a32251a1f696b49ca151308fda to your computer and use it in GitHub Desktop.
ETL project - generate log data
import os
from common.s3_utils import copy_to_s3
from common.system_utils import execute_local, del_local_file
import datetime
def generate_data():
path = "/Users/nikki/work/code/Fake-Apache-Log-Generator/"
os.chdir(path)
cmd = ["./venv/bin/python", "apache-fake-log-gen.py", "-n", "1000", "-o", "GZ"]
execute_local(cmd)
# List files in current directory
files = os.listdir(os.curdir)
# particular files from a directories
list = [path + k for k in files if 'access_log' in k]
print(list)
return list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment