KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Problem with Date Variables

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
UKortkamp



Joined: 01 Dec 2005
Posts: 12

PostPosted: Fri Jun 18, 2021 6:43 am    Post subject: Problem with Date Variables Reply with quote

Hello Community,
Exchange names its log files in the UTC Time format: e. g. RECV2021061811-1.log
for 18. June 2021 11:00 - Instance 1
But local time is 13:00 (GMT+1 and Summertime)

To search the log files for a string I try RECV%yyyymmdd%%hh[-2h]%-1.log

Alternately tried: RECV%yyyymmddhh[-2h]%-1.log

No matter which formatting I enter, HM sends me back "Unknown."
If I explicitly enter a LogFileName (like the example above) the search string is found.

With variables, the checkmark “Translate macros” is activated.

The funny thing: if i use %NewestFile% instead RECV%yyyymmdd%%hh[-2h]%-1.log i get no error -- but even no result.


a) What am I doing wrong?
b) there is a way to see how the translated variables look => which file HM trying to open?




HM Latest Version 12.90

Kind regards
Uwe
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12454
Location: USA

PostPosted: Fri Jun 18, 2021 7:19 am    Post subject: Reply with quote

There are no such option [-2h]. You may add/substract days, months or years.
Do you use Text Log test? And you want to check latest log file? Then use %NewstFile% variable

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
UKortkamp



Joined: 01 Dec 2005
Posts: 12

PostPosted: Fri Jun 18, 2021 8:04 am    Post subject: Reply with quote

Thanks for your fast answer Alex

KS-Soft wrote:
There are no such option [-2h]. You may add/substract days, months or years.


According the examples it was my hope that "H" also works... OK: explains the Unknown-Error

KS-Soft wrote:

Do you use Text Log test? And you want to check latest log file? Then use %NewstFile% variable


%NewstFile% or %NewestFile% (from Doku).

ukortkamp wrote:

The funny thing: if i use %NewestFile% instead RECV%yyyymmdd%%hh[-2h]%-1.log i get no error -- but even no result.


Kind regards
Uwe
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12454
Location: USA

PostPosted: Fri Jun 18, 2021 9:04 am    Post subject: Reply with quote

What means "no result"? Ok test status?
Text Log tests does not check old records in the log. It checks only new records (added since previous check).
If you need to check all (old) records, use Compare Files test

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
UKortkamp



Joined: 01 Dec 2005
Posts: 12

PostPosted: Mon Jun 21, 2021 5:58 am    Post subject: Reply with quote

KS-Soft wrote:
What means "no result"? Ok test status?


"no result" means:
i put in a search string which appears all ~5 min and wait about 30 min and get no "BAD" Message.

Same Test with explicitly enter a LogFileName (according to actually time) i get a "BAD Message" after 5 min.

Therefore my question if I can see somewhere in the log how the variables were resolved at runtime to determine which file was effectively read.

Kind regards and thanks for your help.
Uwe
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12454
Location: USA

PostPosted: Mon Jun 21, 2021 6:10 am    Post subject: Reply with quote

https://www.ks-soft.net/hostmon.eng/mframe.htm#actions.htm#macro
the following variables provide information about the file detected by Folder/File Availability test method or the file processed by other file-related test methods (Text Log, Folder/File Size and Compare Files).
%FileName% - Name of the file. Useful when you setup the test using wildcards or variables in "filename" field.

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
UKortkamp



Joined: 01 Dec 2005
Posts: 12

PostPosted: Mon Jun 21, 2021 6:26 am    Post subject: Reply with quote

KS-Soft wrote:
https://www.ks-soft.net/hostmon.eng/mframe.htm#actions.htm#macro
the following variables provide information about the file detected by Folder/File Availability test method or the file processed by other file-related test methods (Text Log, Folder/File Size and Compare Files).
%FileName% - Name of the file. Useful when you setup the test using wildcards or variables in "filename" field.

Regards
Alex


Thanks!
That seems the problem:



HM is looking in RECV2021062111-1.LOG (Top of the hardcopy ist the notify subject from "GOOD: Teste %FileName%")
Bottom of the hardcopy is same folder from explorer view with RECV2021062112-1.LOG as newest file

Edit: no Webspace to share the img - and OneDrive only generates those links..

Edit 2: Found space

SORRY
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12454
Location: USA

PostPosted: Mon Jun 21, 2021 6:51 am    Post subject: Reply with quote

time of last modification for both files?
I think since Windows Vista some Windows functions may report wrong file size and time in case file is still open..

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
UKortkamp



Joined: 01 Dec 2005
Posts: 12

PostPosted: Mon Jun 21, 2021 7:09 am    Post subject: Reply with quote

KS-Soft wrote:
time of last modification for both files?
I think since Windows Vista some Windows functions may report wrong file size and time in case file is still open..

Regards
Alex


You are right!
LastModify Time of RECV2021062112-1.LOG and RECV2021062111-1.LOG are absolute identical. Dont know why "12" ist not updated when Exchange writes new log entries!?

Is there any possibility to take "Last Creation Time" instead "Last Modify Time" or to integrate a [-xh] Option?

Regards
Uwe
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12454
Location: USA

PostPosted: Mon Jun 21, 2021 9:18 am    Post subject: Reply with quote

Please e-mail to support, we will provide update

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index