Created
December 8, 2011 16:17
-
-
Save coderforhire/1447472 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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