Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-14-2013, 01:52 AM
MacGyver27 MacGyver27 is offline
Registered User
 
Join Date: Jun 2013
Posts: 13
Script for highlighting command output

Hey,

I am sorry if there is any related topic but couldn't find it. Here is my question.

I have a script which runs some sort of health check on device, it also prints logs from device. Here I would like to have some function which will just "inspect" strings which are being printed to the screen and if it detects string which was specified it will change font to predefined format just for that particular string, so the effect will be if in the log I will have "State change to down" only this sentence will be with different color and similarly for other strings I specify.

I am looking for something which I can just "call" before waiting for the prompt.

Thanks, I hope it is clear, Michal

Last edited by MacGyver27; 06-14-2013 at 08:09 AM.
Reply With Quote
  #2  
Old 06-14-2013, 09:11 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Michal,

I would like to get clarification of your goal.

Are you actually talking about writing color data to a log file that can be printed, or are you wanting to see a different color in the terminal window?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 06-17-2013, 01:59 AM
MacGyver27 MacGyver27 is offline
Registered User
 
Join Date: Jun 2013
Posts: 13
Just on the screen... Imagine situation you log on some device and execute show log. My goal here is to highlight on the screen particular strings I specify. E.g. "state changed to down" or " state changed to admin down" "cpu exception:" "counter cleared" ... so if some of this strings appears in the log they will be different color.

Thanks, Michal
Reply With Quote
  #4  
Old 06-17-2013, 09:18 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Michal,

It looks like you want to be able to colorize keywords when they are highlighted in the terminal window. I have created a feature request to add this capability. Should a future release of SecureCRT be able to colorize highlighted keywords, we will post to this thread.

If you would like to be notified directly, please complete and submit the form at the following location:
Submit Feature Request
In the meantime, you are able to highlight keywords using the section called Highlight keywords located in the Terminal / Appearance category of the Session Options dialog.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #5  
Old 06-19-2013, 05:27 AM
MacGyver27 MacGyver27 is offline
Registered User
 
Join Date: Jun 2013
Posts: 13
Thanks for the reply, but this what you are suggesting isnt the right way.. it allows to highlight only simple keywords without any space.. what I want is to detect whole string containing multiple keywords.

As you can see on the picture it doesnt allow me to detect specific string.





This thing with highlighting keywords was almost what I wanted. So do you think there is another way via script how to detect particular string and apply to it my highlight settings? Something in the manner like waiting for the "#" prompt before executing another command, where I will be waiting for one of my specified strings and when match occurs it will highlight that string in the terminal output or whatever, change color ..

Thank you, Michal

Last edited by MacGyver27; 06-19-2013 at 05:44 AM.
Reply With Quote
  #6  
Old 06-19-2013, 08:52 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Michal,

Thanks for the information. Currently, you would need to specify the keywords separately. I have created two feature requests. One to allow specifying strings rather than words (keystring highlighting), and the other to add an object to the crt scripting API that would allow one to programmatically highlight keywords.

Should we add either feature to SecureCRT in the future, we will post to this thread.

If you would like to be notified directly, please complete and submit the form at the following location:
Submit Feature Request
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #7  
Old 06-21-2013, 10:54 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Michal,

I was discussing this with a colleague, and we may have another option.

Can you help me understand what you hope to gain by coloring the keywords in the terminal window?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #8  
Old 10-02-2013, 12:12 PM
mzistler mzistler is offline
Registered User
 
Join Date: Oct 2013
Posts: 1
I can give you an example where this add on feature would be very helpful. In monitoring SIP traffic on a router where you can quickly enter in the phone number you are looking to trace.
Reply With Quote
  #9  
Old 10-02-2013, 02:50 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi mzistler,

Thanks for the scenario. We will post to this thread if we add this type of functionality.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #10  
Old 10-03-2013, 04:20 AM
GJB56 GJB56 is offline
Registered User
 
Join Date: Nov 2011
Posts: 22
I also think this would be a very useful feature. I use CRT mainly in a lab test environment so my use may be different from others The most useful highlighting in my case would be to highlight strings in the buffer by using the find command (or a command under the tools menu) where the I could choose "stringList1 or stringList2...". All strings in the chosen list would then be highlighted in the scrollback buffer.
Reply With Quote
  #11  
Old 10-03-2013, 10:41 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi GJB56,

Thanks for your input. I have created a feature request to add a real-time ad hoc find/search feature that highlights what is found. We will post to this thread if that is added. We will also post if the ability to search for strings or if the ability to use color with keyword highlighting is added as well.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #12  
Old 04-21-2014, 03:24 PM
Maureen's Avatar
Maureen Maureen is offline
VanDyke Product Director
 
Join Date: Feb 2004
Location: Albuquerque, NM
Posts: 1,583
The ability to specify colors for keyword highlighting has been added to a pre-beta version of SecureCRT. If you would be interested in trying it, please send email to me at Maureen.Jett@vandyke.com.

Maureen
Reply With Quote
  #13  
Old 12-17-2019, 05:41 PM
Maureen's Avatar
Maureen Maureen is offline
VanDyke Product Director
 
Join Date: Feb 2004
Location: Albuquerque, NM
Posts: 1,583
The ability to match phrases and substrings when doing keyword highlighting has been added to SecureCRT 8.7, which is currently in beta testing. It can be downloaded here.

Maureen

Last edited by bgagnon; 12-18-2019 at 07:34 AM. Reason: Broken link
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 05:46 PM.