Hi All,
I wanted to parse a log file, so came across Grok. Installed the gem and
tried the below example that is given in the documentation below:
require ‘grok’
configure do |c|
c.file = “/var/log/auth.log”
c.interval = 2
c.replay = 0
end
When i run the above code, i get the following error:
C:\examples\code\grok>ruby parselog.rb
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in
require': C:/Ruby192/lib/ruby/gems/1.9.1/gems/grok-0.0.5/lib/grok/watcher.rb:121: syntax C:/Ruby192/lib/ruby/gems/1.9.1/gems/grok-0.0.5/lib/grok/watcher.rb:137: syntax error, unexpected keyword_end, expecting $end from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in
require’
from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/grok-0.0.5/lib/grok.rb:1:in <top (required)>' from <internal:lib/rubygems/custom_require>:33:in
require’
from internal:lib/rubygems/custom_require:33:in rescue in require' from <internal:lib/rubygems/custom_require>:29:in
require’
from parselog.rb:1:in `’
What has gone wrong here?