Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

event logs

Status
Not open for further replies.

cpu533

IS-IT--Management
Nov 6, 2003
68
CA
Hi,
I check the events table, it only contains today' events log. But which table contains the old even log if you set retension say 10 days. I know we can issue " q event * * begindate=today-N" to get old event log. But there must be somewhere to held the data. Any ideas?

Thanks,
Denny
 
try
select * from events where days(current_timestamp)-days(scheduled_start)<1

as one line :)
just change <1 to <4 and so on.

/regards Daniel
 
Thanks for reply, but I do not think that works.
Check the output from select * from events.

SCHEDULED_START: 2006-02-27 00:30:00.000000
ACTUAL_START: 2006-02-27 00:42:09.000000
DOMAIN_NAME: BADOMAIN
SCHEDULE_NAME: BANODE1_SCHEDULE
NODE_NAME: BANODE1
STATUS: Completed
RESULT: 0
REASON:

There is no colume indicates the days.

Thanks,
Denny
 
Hi!
I see your point.
days is not a column it is a function that only returns the day value of the time_stamp and then you can do some maths on that value ;)


/regards Daniel
 
Hi Daniel,
I understand that days is a function.
Regarding the events table, even you did not specify the criteria, you can only see today's data. So your query does not work. There must be some other table helds the old data.

Thanks,
Denny
 
Hi Danny!

You are quite right something has changed.

I have tried this and it produces the right results.

select * from events where scheduled_start between '2006-02-24 00:00:01' and '2006-02-27 23:59:59'

So I am trying to create the strings by doing a cast:
select * from events where cast(scheduled_start as char(10)) between cast((current_date - 10 days) as char(10)) and cast(scheduled_start as char(10))
but it does not produce the older data. :(


/daniel
 
Thanks Daniel, it works using "select * from events where scheduled_start between '2006-02-24 00:00:01' and '2006-02-27 23:59:59'". That means the data still hides in the events table, but somehow it would not show up until you using the correct criteria. Sounds strange.

Thanks for your help again.

Denny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top