It's all about the answers!

Ask a question

how to limit output from .edit command to step log?


Michael Dang (1334) | asked Aug 25 '14, 9:02 a.m.

Hi All,

We used the .edit command to find and replace files, and each about 400,000 lines. Dot command .edit writes all lines that it finds and replace to step log which is too many. All we want is success or failure output to step log; is there a way to do so? Please help!

Thanks

Michael

Accepted answer


permanent link
Ryan Ruscett (1.0k413) | answered Aug 25 '14, 9:17 a.m.
 Hello Michael,

There are two trigger variables that can be used. 

  • _SUPPRESS_ENV_OUTPUT: if set, suppresses the printing of ENV messages on the step log.
  • _SUPPRESS_LOG_OUTPUT: if set, suppresses the printing of nearly all messages on the step log.
To see a full list of trigger variables including the two above with additional information see the link below.


You can set these in the environment, or even better, when you go to start the project, you can have an environment variable for the project as a drop down. This way you can select to either have the option on or off. 

Let me know if this helps!
Thanks! 

Michael Dang selected this answer as the correct answer

Comments
Michael Dang commented Aug 25 '14, 9:57 a.m.

Great, Thanks.

4 other answers



permanent link
Michael Dang (1334) | answered Sep 17 '14, 9:29 a.m.
 Hi Ryan,

Thanks for the answer. But trigger variable "
  • _SUPPRESS_LOG_OUTPUT: if set, suppresses the printing of nearly all messages on the step log." 
We still want some of the outputs just in case of errors. I am experiencing that if tigger variable above is set, and if there is error for other command like "sqlplus" does not give us clear info. Is there a way for just limited for dot command ".edit" only?

Any ideas?

permanent link
Ryan Ruscett (1.0k413) | answered Sep 17 '14, 12:44 p.m.
 Hey Michael,

Well, there is _CONTEXT_LOG_RANGE. When a project fails, it fails with a "FilterMatch". What this value does is limit the actual log output to just what is surrounding match on the filter. 

This way if my project fails. It will print out lines before and after my failure. For example, if I set this value to 10. It will print out the 10 leading and 10 following log lines surrounding the Filter Match or AKA: Failure. 

This can help give insight into why it's failed if that is what you are looking for. You can also set this per project or per step. 

LASTLY, 

Ok, well let's say I want other information. Say something fails but does not actually get caught by a filter. Well, you can go and create your own filters in which to catch certain information that will allow the LOG_RANGE to work. 

Well, this is the last part. Say, you made the variable a drop down with 1, 5, 10... values. Normally you have it set to 1. So nothing really get's printed. But you can restart the build, and on the launch page, find the value and use the drop down to select 10. Then it re-runs the step, fails and prints out 10 lines. You find your answer you change it back to the default of 1. This works the same with the SUPPRESS of the log data. Just a handy way to turn on and off and not have to actually edit the project each time... What a pain!

Hope this helps you? 
Please let us know by liking our answers if they are correct. 
Thanks!

permanent link
Michael Dang (1334) | answered Sep 17 '14, 1:17 p.m.
Hi Ryan,

Thank you for the response quickly.
In this case, we have to create a log filter looking a range of error strings, then set trigger varialbe _CONTEXT_LOG_RANGE, and NOT set trigger varialbe _SUPPRESS_LOG_OUTPUT, correct? If it is true, a lot of work.

Are these only options for us to eliminate massive outputs from .edit command? If so, we are going to write our own edit command script, and suggesting for enhancing .edit command.

Thanks
Michael

permanent link
Ryan Ruscett (1.0k413) | answered Sep 17 '14, 5:38 p.m.
 Hey, 

Yeah, so you just need to set _context_log_range and  _suppress_log_output. Then set context range to however many lines before and after the error you want. 


You don't need to create filters, they should already all be there. This is just something that you can do for very special

circumstances. An option for other readers who may read the post and wonder about it. 

As far as .edit goes it's really only meant to be used like string substitution. To find and replace values and there is no

way to limit it. 

Sorry I don't have any other creative ways of getting exactly what you are looking for but hopefully this helps. 

Thanks!

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.