thanks to the guys who replied my last post, it quite helps! So I am trying to parse the log and filter out something, the log looks like :

v=5,ci=3,si=60,sv=1,ss=active,es=-,ai=a23-369b-4da3-b2da-630aee75f8c5,ip='99.114.107.39',rm=GET,rv=HTTP/1.1,rs=200,rt=0.787020,rr='/tag/febe1eab436e98eb4ed3711870496c91/st.js?l=http%3A%2F%2Fwww.michaels.com%2Fv

The output should be print out by splitting by ',' , line by line, and also filter out something that I don't need. eg. I only need 'ip' and 'rr' attributes, so the output should look like:

ip='99.114.107.39'
rr='/tag/febe1eab436e98eb4ed3711870496c91/st.js?l=http%3A%2F%2Fwww.michaels.com%2Fv

I made the change to the code which given yesterday, but it doesn't work, anyone could help me



<!doctype html>
<html>
<head>
<title>reading file</title>
<script>
function readText(obj){
var file = obj.files[0],
div=document.getElementById('main');
if(file){
div.innerHTML='';
var reader = new FileReader();
reader.onerror = function(event){
div.innerHTML='The file can\'t be read! Error ' + event.target.error.code;
}
reader.onload = function(event){
var cont = event.target.result.split(',');
for(var i=0; i<cont.length; i++){
var name = cont.split('=');
if (name[0]=="rr") {
div.innerHTML+=cont[i]+'<br />';
}

}
}
reader.readAsText(file);
}
}

window.onload=function(){
document.getElementById('ff').onchange=function(){readText(this);}
}

</script>
</head>
<body>
<input type="file" id="ff" />
<div id="main"></div>
</body>

</html>