wildcards and macros

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
berimu
Posts: 6
Joined: Fri Feb 11, 2005 6:12 am
Location: Netherlands
Contact:

wildcards and macros

Post by berimu »

I want to check a file, that is created once a week, if there is a certain string in it.
The file name is YYYYMMDD_HHMMSS.log Using a wildcard. But this does not seem to work.
To check the file I use %YYYYMMDD%_*.log
Is there a different way? Or do I do thing wrong?

Ivo
Yoorix
Posts: 177
Joined: Wed Dec 14, 2005 8:28 am

Post by Yoorix »

You have written macros correctly. It should works.

Are you sure you have checked checkbox "Use date macros" followed by filename input box?

Do you provide file location path correctly?

Regards,
Yoorix
Yoorix
Posts: 177
Joined: Wed Dec 14, 2005 8:28 am

Post by Yoorix »

O-o! Sorry! I pressed Sumbit button too early :-)

Try to remove "_" from filename. It should helps.
Try use %YYYYMMDD%*.log instead of %YYYYMMDD%_*.log

Regards,
Yoorix
berimu
Posts: 6
Joined: Fri Feb 11, 2005 6:12 am
Location: Netherlands
Contact:

Post by berimu »

Sorry too,

Every week a system automatically updates and writes a log file. It starts aon monday 12:00 o'clock and end at a certain time . The date is known but not the endtime. So I use the Test method "compare" "File contains " and the translate macros checked for the string FAILURE.
I hope to check if somewhere in the file I see a Failure.
For example in the file 20060201_132218.log
I check on \\servername\d$\Data\applicationname\Logs\%yyyymmdd%_*.log
Yoorix
Posts: 177
Joined: Wed Dec 14, 2005 8:28 am

Post by Yoorix »

As I wrote above,
could you apply that string:
\\servername\d$\Data\applicationname\Logs\%yyyymmdd%*.log ,
without "_".
I think in this case character "_" is processed incorrectly.

Regards,
Yoorix
Yoorix
Posts: 177
Joined: Wed Dec 14, 2005 8:28 am

Post by Yoorix »

Why don't you use "Text log" test method instead of "Compare Files"?
I think you should use "Text log" in your case.

Regards,
Yoorix
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

"Compare Files" test method does not support wildcards.
"Text Log" test method is not appropriate in such case because application creates log file at once, it does not add records one by one during the week. Right?

Solution? H'm.. How do you start that application? Can you use some BAT file to start the application and rename log file when application terminates?

Regards
Alex
Yoorix
Posts: 177
Joined: Wed Dec 14, 2005 8:28 am

Post by Yoorix »

[quote="KS-Soft"]"Text Log" test method is not appropriate in such case because application creates log file at once, it does not add records one by one during the week. Right?[/quote]

I've understood, that application creates log file once a week by pattern YYYYMMDD_HHMMSS.log and problem is to check matching to this pattern, isn't it? In this case, I think, 'Text log' test gets better.

Regards,
Yoorix
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

"Text Log" test method checks for NEW records in the file that already EXISTS

Regards
Alex
berimu
Posts: 6
Joined: Fri Feb 11, 2005 6:12 am
Location: Netherlands
Contact:

Post by berimu »

Did some testing and....... "Text log" is not usable.
But the "Compare" does seem to work using the %YYYYMMDD%*.log notation.
I created a testfile that gave a error when string "Failure" was found and no error when the string was not found. (So far so good.

HOWEVER When I created an error I received reply: Cannot open file \\servername\d$\Data\Logs\20060210*.log
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Compare Files test method does not support wildcards

Regards
Alex
berimu
Posts: 6
Joined: Fri Feb 11, 2005 6:12 am
Location: Netherlands
Contact:

Post by berimu »

Anyway.
Using the wildcard it does seem to work and finds the correct file. Alas I indeed get the error message.
I also will try to change the logfile name.
Thank Ivo
Post Reply