Skip to content

Instantly share code, notes, and snippets.

Created May 2, 2015 21:51
Show Gist options
  • Save anonymous/5bd125a8809f39e1bb71 to your computer and use it in GitHub Desktop.
Save anonymous/5bd125a8809f39e1bb71 to your computer and use it in GitHub Desktop.
Pseudo:
for every line in the access log, sorted by timestamp ascending {
let sessionId be the session id for this line
let timestamp be the timestamp for this line
let end be the timestamp of the last processed line with given sessionId (null if not started)
if end != null and timestamp – end > 30 minutes then
assign a new session id to this line and all coming lines which have a session id == sessionId
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment