Created
March 6, 2022 16:35
-
-
Save CognitiveDave/6b569f6106ea6412404f084b0c62025c to your computer and use it in GitHub Desktop.
This file contains 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
records = [] | |
count = 0 | |
for entry in logLines: | |
elems = entry.decode('utf-8').split('"') | |
if(len(elems)) > 1: | |
count += 1 | |
rec = { | |
'remote_addr' : elems[0].split(' ')[0], | |
'remote_user' : elems[0].split(' ')[1], | |
'time_local' : elems[0].split("[")[1].replace("]","").strip(), | |
'request': elems[1], | |
'status': elems[2].split(" ")[1], | |
'bytesSent': elems[2].split(" ")[2], | |
'referrer': elems[4], | |
'agent': elems[5]} | |
records.append(rec) | |
import pandas as pd | |
df = pd.DataFrame(records) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment