Question: import re # DO NOT EDIT THIS LINE # Function that takes a file and loads it into a Python list variable and # returns

import re # DO NOT EDIT THIS LINE
# Function that takes a file and loads it into a Python list variable and
# returns a list variabe with each item being a line from the file
def load_file_into_list(filename):
with open(filename) as f:
lines = f.read().splitlines()
return lines
def main(): # DO NOT EDIT THIS LINE
print("Welcome to the Log Analyzer!")
# PART A
# ======
# Create a variable and set its value to the response from an input call asking
# for a filename of a log file ("What log would you like to parse?"). To test your
# code, you should enter the name of the log file in the repository, which is
# lab6_data_problem1.log
## YOUR CODE HERE ##
# PART B
# ======
# Using the load_file_into_list function, load the lines from the log file into a
# list variabe named lines
## YOUR CODE HERE ##
# PART C
# ======
# You will be looking for unique IP addressed and usernames (in DOMAIN\username
# format) in the log file. Create two lists that will hold these values for display
## YOUR CODE HERE ##
# PART D
# ======
# Create a new python regular expression object by compiling an expression to
# look for an IP address
## YOUR CODE HERE ##
# PART E
# ======
# Search the contents of each line for an IP address. If there is a match and that match
# doesn't already exist in the list, append it to the list. Remember, IP addresses look like
# 12.34.56.78
## YOUR CODE HERE ##
# PART F
# ======
# Create a new python regular expression object by compiling an expression to
# look for user accounts. User accounts will be in the format DOMAIN\username
## YOUR CODE HERE ##
# PART G
# ======
# Search the contents of each line for a user account using the regular expression you created.
# If there is a match and that match doesn't already exist in the list, append it to the list
## YOUR CODE HERE ##
# PART H
# ======
# For each IP address you found, print it to the screen
## YOUR CODE HERE ##
# PART I
# ======
# For each user account you found, print it to the screen
## YOUR CODE HERE ##
return # DO NOT EDIT THIS LINE
if __name__=="__main__": # DO NOT EDIT THIS LINE
main()# DO NOT EDIT THIS LINE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!