I want to parse a large log file (about 500mb). If this isnt the right tool for the job please let me know.
I have a log file with its contents structured like this. Each section can have extra key value pairs:
requestID: saldksadk
time: 92389389
action: foobarr
----------------------
requestID: 2393029
time: 92389389
action: helloworld
source: email
----------------------
requestID: skjflkjasf3
time: 92389389
userAgent: mobile browser
----------------------
requestID: gdfgfdsdf
time: 92389389
action: randoms
I was wondering if there is an easy way to handle each section's data in the log. A section can span multiple lines, so I can't just split the string. For example, is there an easy way to do something like this:
for(section in log){
// handle section contents
}
splitthe file. It's just not a scalable solution.yield, I believe.