Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-16-2020, 06:58 AM
AlexG AlexG is offline
Registered User
 
Join Date: Jan 2020
Posts: 5
Multiple tabs/logs with time stamps

Hello,
Need help please.
I am running Python script that opens a few tabs, each to the same IP but different port. Activate log per tab. In addition, want to have time stamp in front of every log’s line.
One option that I may use – is to configure default session with option “on each line” something like “%h-%m” and to use in the script option “crt.Session.LogUsingSessionOptions” which will set per tab default configuration including per line time stamp. However, since I have same IP and different ports per tab, I have no option to have unique log name. I may include Host name (IP) as part of name (%H) and session name %S (which in default session is the same for all tabs), but there is no option to include port as part of name. Therefore, I get a few log files with the same name (including time stamp into log name does not help to distinguish between them). Not sure whether I could change name on later stage, also would help.
Another option that I tried, is to configure each session individually, like:
objTab.Session.Log (False)
objTab.Session.Config.SetOption("Custom Log Message Each Line", "%D_%h_%m")
objTab.Session.LogFileName = strPath + strCaption + "(" + port + ")_%D-%M-%Y-%h_%m_%s.txt"
objTab.Session.Log (True)
I get unique names for log files but no time stamps.
Much appreciate help.
Reply With Quote
  #2  
Old 02-17-2020, 01:45 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi AlexG,

I have replicated your results and have created a bug report.

I will post here if the developers have further questions or when there is further news.

For direct notification, please send an email to support@vandyke.com and reference Forum Thread #14080 in the subject line.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 02-17-2020, 01:52 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi AlexG,

As a note:

Changes in SecureCRT 8.3 (Beta 1) -- September 21, 2017
-------------------------------------------------------
New features:
  • Added support for the %P logging substitution for Serial sessions.
Not sure why the history note specified Serial. I just tested with an SSH connection to an alternate port and it worked.


I see, we actually added it for other protocols much earlier.

Changes in SecureCRT 7.1 (Beta 1) -- February 26, 2013
------------------------------------------------------
New features:
  • Added a new logging substitution variable "%P", which inserts the session's port.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730

Last edited by bgagnon; 02-17-2020 at 01:59 PM. Reason: Info on original %P in v7.1
Reply With Quote
  #4  
Old 02-18-2020, 06:01 AM
AlexG AlexG is offline
Registered User
 
Join Date: Jan 2020
Posts: 5
Multiple tabs/logs with time stamps

Dear Brenda,
Thanks a lot. I was using 7.0.3 version.
After I upgraded to 7.3.3 I indeed found option for %P for logs distinguishing and was able to get time stamps in each line of multiple logs using crt.Session.LogUsingSessionOptions.
But I found that to have time stamps, I have to enable "Start log upon connect", otherwise no time stamps. Here I got next "trap".
In my case I will have multiple disconnections and connections. Therefore, new log will be opened upon each connection and having tenths or hundreds such for sure complicates analysis.
If I will use "Append to file" option to avoid multiple new logs, file name should not have time stamp to allow this.And then if I am running script next time, it will append data to previous log which is not convenient.
Any idea how to overcome this?
Thank you
AlexG
Reply With Quote
  #5  
Old 02-18-2020, 10:29 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi Alex,

As a note, any changes/fixes are going to be in v8.7 or later.

The only way I know to solve your dilemma presently is to not use timestamps as part of the filename. For sure, not the second specification and possibly minute and hour depending on how often you need to stop/start logging.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply

Tags
log , session log , time stamp

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 12:54 AM.