Created
January 14, 2019 09:33
-
-
Save nikkisharma536/18e863a32251a1f696b49ca151308fda to your computer and use it in GitHub Desktop.
ETL project - generate log data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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