Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Daniel Berger
RE: Filtering event data [ reply ]  
2008-05-12 22:35
Hi Graham,

Input from STDIN is a string, while the event_id is a number. If you convert inputid to an integer via .to_i it should work.

Regards,

Dan

By: Graham Cowie
Filtering event data [ reply ]  
2008-05-12 20:47
Below is snippet of code which I think should work however does not. What I am doing is carving out event id based on user input. For example the user asks for all user ids 1000 and all those ID;s are carved out of the event log.
puts "What Event ID would you like?"
inputid=STDIN.gets.chomp
puts "The ID is " + inputid
EventLog.new do |log|
log.read{ |entry|
if entry.event_id==inputid
puts entry.event_id
puts entry.user
end
}
end