Skip to content

Instantly share code, notes, and snippets.

@coderforhire
Created December 8, 2011 16:17
Show Gist options
  • Save coderforhire/1447472 to your computer and use it in GitHub Desktop.
Save coderforhire/1447472 to your computer and use it in GitHub Desktop.
def Parse(data)
if data.match(/Accepted publickey for/)
line_to_breakdown = data
last_login = line_to_breakdown.match(/[A-Z][a-z][a-z]\s\s\d\s\d\d:\d\d:\d\d/).to_s
@last_login = Time.parse(login_time).to_i
last_login = @last_login_time.to_s
ip_address = line_to_breakdown.match(/(\d{1,3}\.){3}\d{1,3}/)
venue = line_to_breakdown.match(/[a-z]\d\d\d\d[\s\S]/)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment