We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,659 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Parse a Log file

Hi,
I am new in a python2.7. Please help how efficiently we parse and store the fields in dictionary for later retrieval.

my log file example

#Version: 1.0
#Fields: date time c-ip s-dns x-proto s-parser cs-resource s-resource sc-response-code sc-response s-candidate-ips x-preferred-location x-location cs-user-agent s-ip c-port
#Software: vx-logfeed 1.3
#Start-Date: 2011-04-20 14:05:00
2011-04-20 14:07:30.3 192.0.2.1 us1.isp1loc1s1.abc dns vxdns wp-1234000000000000.id.abc.example.com wp-1234000000000000 NOERROR 198.51.100.201,198.51.100.211 198.51.100.101,198.51.100.102 n.isp1.serv.us.ny n.isp1.serv.us.ma - 198.51.100.101 2323
#End-Date: 2011-04-20 14:10:00
#X-Records: 1

thanks

3
Contributors
2
Replies
11 Hours
Discussion Span
1 Year Ago
Last Updated
3
Views
uvaryani
Newbie Poster
1 post since Aug 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Just paste your code after pushing the (code) button, include full erroo mesages and explain what you tried to fix it.

pyTony
pyMod
Moderator
6,299 posts since Apr 2010
Reputation Points: 879
Solved Threads: 984
Skill Endorsements: 26

It appears that this forum has a reputation for free code as I don't see this much on other forums. But then again, if you are the OP of the "calculating the avg and std" post, you know that you can just keep asking questions until someone provides a complete solution.

woooee
Posting Maven
2,703 posts since Dec 2006
Reputation Points: 827
Solved Threads: 777
Skill Endorsements: 9

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0575 seconds using 2.66MB