Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. 10.0.0.3 - - [08/Jul/2019:10:26:41 +0000] "GET /hello.html HTTP/1.1" 404 444 "-" "curl/7.52.1"
  2. 10.0.0.3 - - [08/Jul/2019:10:26:41 +0000] "GET /hello.html HTTP/1.1" 404 444 "-" "curl/7.52.1"
  3. 10.0.0.3 - - [08/Jul/2019:10:26:41 +0000] "GET /secret.html HTTP/1.1" 200 282 "-" "curl/7.52.1"
  4.  
  5. File.open("access.log").each do |line|
  6. m = /(d{1,3}.d{1,3}.d{1,3}.d{1,3})(.+/)([a-zA-Z0-9]+.html)/.match(line)
  7. puts m
  8. end
  9.  
  10. 10.0.0.3 - - [08/Jul/2019:10:26:41 +0000] "GET /hello.html
  11.  
  12. 1.rb:25:in block in <main>': undefined method []' for nil:NilClass (NoMethodError)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement