Reporting on failed Backup from log files

(imported topic written by hanspjacobsen)

I’m trying to figure out if there is a way to to report on successful backup of Oracle based on a log file. What I’m looking to do is for BigFix to automatically report when backup has not been successful the past two days. The report will be based upon one log file from Oracle and one from TSM. Can someone describe how I should move forward?

Thanks

Hans

(imported comment written by brolly3391)

Hello Hans,

Do the two log files exist on the same endpoint?

Are the entries in the log files timestamped?

If the answer to both of those questions is yes, then you could use an analysis to scan these files for your “has not successfully backed up in 2 days” condition.

Here is a simple example of scanning a log for a success in the last 2 days:

c:\ora.log

31 JUL 2007 - 14:45:44

  • Backup was successful

01 AUG 2007 - 14:55:13

  • Backup failed

02 AUG 2007 - 15:02:53

  • Backup was successful

relevance for analysis or retrieved property:

exists ((lines whose (it as lowercase contains “backup was successful” AND (current date -(preceding text of position 11 of following text of position 1 of it as date)) >= 2*day) of file “c:\ora.log” ))

I used an easy to handle date format in my log but any format can be handled with careful string processing.

I would need more details to get any more specific.

Cheers,

Brolly

(imported comment written by hanspjacobsen)

Hi Brolly changed the log file a bit and it returns true no matter how long ago it was ago the log file returns true.

log file

01 JUL 2006 - 14:45:44

  • backup was successful

01 AUG 2007 - 14:55:13

  • Backup failed

10 AUG 2007 - 15:02:53

  • backup was successful

Relevance

Q: exists ((lines whose (it as lowercase contains “backup was successful” AND (current date -(preceding text of position 11 of following text of position 1 of it as date)) >= 2*day) of file “C:\download\bigfix\training\backuplog.txt” ))

A: True

Thanks Hans

(imported comment written by BenKus)

Hey Hans,

I think maybe if you want only entries in the last 2 days, try reversing the “>=” to “<=”.

Ben

(imported comment written by hanspjacobsen)

Hi Ben thanks for your suggestion but it doesn’t help.

What happens is that the relevance retunes true no matter how far back the log file say’s that the backup was successful.

Thanks

Hans

(imported comment written by BenKus)

Hi hans,

Are you sure you went back far enough? The successful date in the log file is in 2006:

01 JUL 2006 - 14:45:44

  • backup was successful

01 AUG 2006 - 14:55:13

  • Backup failed

02 AUG 2006 - 15:02:53

  • Backup failed

This works for me:

// Has there been a successful backup in the last 4 days?
q: exists ((lines whose (it as lowercase contains “backup was successful” AND (current date -(preceding text of position 11 of following text of position 1 of it as date)) <= 4*day) of file “C:\backuplog.txt” ))
A: False

// Has there been a successful backup in the last 500 days?
q: exists ((lines whose (it as lowercase contains “backup was successful” AND (current date -(preceding text of position 11 of following text of position 1 of it as date)) <= 500*day) of file “C:\backuplog.txt” ))
A: True

Ben

(imported comment written by hanspjacobsen)

Thanks ben that was the correct syntax it works as it should now.

Hans