Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tygra authored and Tygra committed Jan 12, 2019
1 parent 6636bc4 commit 03f131d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
23 changes: 10 additions & 13 deletions columnsFormat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,19 @@ def Format.columnsFormat(line,dataset,option,filter)
end
h['types']=filter.getTypeOfContent(h['url'],part[15])
else
h['uIP']=part[1]
h['url']=part[2]
h['uIP']=part[2]
h['url']=part[4]
# if part[2].include? "http"
# h['url']=part[2].split("://").last
# end
h['host']=part[19] if part.size>18
h['host']=Utilities.calculateHost(h['url'],nil) if h['host']==nil
h['type']=filter.getTypeOfContent(h['url'],part[3])
h['type']="other" if h['type']==-1 or h['type']=="" or h['type']==nil
h['tmstp']=part[4]
h['tmstp']=DateTime.rfc3339(part[4]).to_time.to_i if part[4].include?(":")
h['dur']=part[5]
h['dataSz']=part[6]
h['status']=part[7] if part.size>7
h['verb']=part[8] if part.size>8
h['httpRef']=part[9] if part.size>9
h['host']=part[5]
h['host']=Utilities.calculateHost(h['url'],part[5]) if h['host']==nil or h['host'].size<2
h['type']=filter.getTypeOfContent(h['url'],nil)
h['tmstp']=part[8]
h['tmstp']=DateTime.rfc3339(part[8]).to_time.to_i if part[8].include?(":").to_s
h['httpRef']=part[6]
h['status']="-"
h['cookie']=part[7]
#Utilities.error("Wrong column format... File cannot be read!")
end
return h
Expand Down
2 changes: 1 addition & 1 deletion csync_detector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def checkCSinURI(urlParts,row,cat,noTLDHost)
end
end
end
@params_cs[curUser][parts[i]].push({"url"=>urlParts,"paramName"=>paramName,"tmstp"=>row['tmstp']+"-REF","cat"=>cat,"status"=>row["status"],"host"=>noTLDHost,"httpRef"=>row["httpRef"], "browser" => row["browser"] , "ua" => row["ua"], "piggybacked" => "URI","wasSynced"=>wasSynced})
@params_cs[curUser][parts[i]].push({"url"=>urlParts,"paramName"=>paramName,"tmstp"=>row['tmstp'].to_s+"-REF","cat"=>cat,"status"=>row["status"],"host"=>noTLDHost,"httpRef"=>row["httpRef"], "browser" => row["browser"] , "ua" => row["ua"], "piggybacked" => "URI","wasSynced"=>wasSynced})
end
end
return found
Expand Down
2 changes: 1 addition & 1 deletion filters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def is_it_ID?(name,value,inParam)
def getTypeOfContent(url,httpContent)
#Find content type from filetype
type=-1
return type if url==nil or url==-1
return type if url==nil or url==-1 or not url.include? ("?")
temp=url.split("?").first.split("/")
if temp.size>1
temp2=temp.last.split(".")
Expand Down

0 comments on commit 03f131d

Please sign in to comment.