Year of Python (YOP) – Week Forty Seven

23Nov15

Hello Reader!

This weeks post is going to be a quick one.  It’s been a crazy week with some personal items I’ve been dealing with.  Which has consisted of sick family members, SNOMGPOCALYPSE, and a 24 hour power outage in my home.  So unfortunately I didn’t get as far with this weeks script as I had hoped, but I have a starting point to work on for week 48.

This week I decided to play around a bit with XML files.  Specifically the log files used by Norton’s NPE utility, which is similar to McAfee Stinger.  At work this week I needed to review some NPE log files, and while it’s easy enough to open it in your favorite browser and navigate through, I thought it would be a nice thing to apply some Python to.

In my research on this script, I started looking at the XML modules that Python already has.  I was struggling a bit with this, because the NPE log files don’t follow a standard format that I was able to utilize very well with the modules out there.  I could get some of the data out of the file, but there were nested tags within the log file that I was having…challenges parsing out.

Then I ran into a post (on Stackoverflow of course) where someone suggested using BeautifulSoup to parse out the data.  I had wanted to do some more work with this module earlier in the year, but it didn’t pan out.  But now I had a good reason to use it.

Which brings me to this weeks script.  All we’re doing at this point is pulling some information out of the log file on the OS of the system it was run against, and then we go through the entire file and print out all the File tags within.  At this stage I was mainly testing out how to parse the data, while I think about the best way to organize and display it.  So there’s not much to it at this point.  However, it does give me the ability to do a quick review of the files listed, and see if there’s anything out of place.

Until next week!

https://github.com/CdtDelta/YOP

Advertisements


No Responses Yet to “Year of Python (YOP) – Week Forty Seven”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: