Created
July 28, 2021 17:43
-
-
Save DerekHawkins/4c8bda582a39eff6b0579bb842c02034 to your computer and use it in GitHub Desktop.
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
# Approach takes into consideration multiple log files stored locally with a .gz format | |
log_file_slugs = os.listdir(r'C:\Users\Derek.Hawkins\Log File Analysis Folder') | |
log_file_slugs = [x for x in log_file_slugs if '.gz' in x] | |
main = [] | |
for i in log_file_slugs: | |
with gzip.open(r'C:\Users\Derek.Hawkins\Log File Analysis\{}'.format(i),'r') as fin: | |
for line in tqdm(fin): | |
try: | |
main.append(log_parse(line.decode())) | |
except AttributeError as e: | |
print(line.decode()) | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment