8 Replies Latest reply on Jan 8, 2020 2:53 AM by Mun Keong Lee

    How to search multiple Job Output

    Simon Ehrlichmann
      Share This:

      Hi,

       

      my first question here in the community.

       

      With fast running Job cycles a lot of outputs are written, which I cannot check all manually.

      How can I search all these outputs in one step with one search term ?

       

      By using the Standard Search Field in the Output Pane only the last written log is searched.

      But what about the logs before ?

       

      Is there a easy way I didn't found ?

       

      Best regards

      Simon

        • 1. Re: How to search multiple Job Output
          Mark Francome

          Hi Simon,

           

          Welcome to the group and Happy New Year!

           

          If you have local access to the Control-M Agent where the jobs are running then you can look in the folder or directory where the actual job output (which old Control-Mers call sysout) is kept (the default location is $HOME/ctm/sysout - or the equivalent location on other Agents, e.g. Windows). These files are usually automatically deleted after a few days (depending on your system setup and the settings defined by the Control-M guy).

           

          An exception to this is if you define move/copy in the Output Handling option of the individual job definition (check the last tab on the job def for this). Also, the Control-M modules use specific directories for output, e.g. AFT on Windows goes (if left to default) to C:\Program Files\BMC Software\CONTROLM-Agent\Default\CM\AFT\sysout

           

          So just use the standard searches on the folders/directories in these locations.

           

          Mark.

          • 2. Re: How to search multiple Job Output
            Bentze Perlmutter

            Hi Simon,

             

            Welcome to the Control-M community.

             

            You can also use Control-M Workload Archiving Advanced Search to search all outputs for a specific string.

            But for this you need to be licensed for and have installed the Workload Archiving solution.

             

            If you're after an automatic way to scan all outputs of a specific job, you can add to the job definition an on/do statement.

            This can tell Control-M to trigger an output scan when the job ends, search for a string, including wild cards but the search is line-by-line based, and if found can perform the DO action you've specified.

             

            Bentze

            2 of 2 people found this helpful
            • 3. Re: How to search multiple Job Output
              Simon Ehrlichmann

              Hi Guys,

               

              many thx for your answers.

               

              At first, I forgot to tell you that I'm searching a solution for end users, which doesn't have access to the Application Servers.

               

              @Mark: Searching the logs directly on the Agents Servers is a good idea, but unfortunately not possible for end users.

               

              @Bentze: I also thought of the Control-M Workload Archiving first. Unfortunately we have not licensed this.

                               The Output scan via on/do Statement could be a possible automatical solution. I'll speak with the requestor about this.

               

              In summary, it can probably be said that there is no other solution out of the box in the monitoring area ?

               

              Simon

              • 4. Re: How to search multiple Job Output
                SIMON LI

                Hell Simon,

                hmm, i think it's not possible because in Monitor domain the output are fetch from agent when requested.

                from mine experience..

                 

                Alternatively, maybe you can share us why user has this request, maybe we can find you some other solution?

                thanks

                Simon

                • 5. Re: How to search multiple Job Output
                  Keyur Patel

                  Hi Simon,

                   

                  Happy New Year..

                   

                  Looking at your response, looks like you need a solution for the end user, where they do not have to go to output folder and search a string

                   

                  With out having full understanding of requirements, what you would like to do when string is found, I assume you want to know how many times string has found with out going through all cyclic output files.

                   

                  I would take below approach

                   

                  Create a Dummy job, then create action item to search a string, when string found copy output to staging directory\folder and order Dummy job instance

                  This way operation can see how many times string has found by counting dummy job instances, also they will have a copy of output saved in different folder for future reference.

                   

                   

                  The only down side to this is it will increase your task count, which can impact your over all cost, if you are on task based license model

                  Hope this will help..

                   

                  Thanks

                  • 6. Re: How to search multiple Job Output
                    Simon Ehrlichmann

                    Hi Guys,

                     

                    thx for your ideas. Many helpful Information.

                     

                    The main question was the following.

                     

                    An Business Enduser Group has to search Control-M Jobouput for some special kewords.

                    The Job's in different chains are running cyclic every Day for some hours.

                    If you have a fast running cyclic, for example every minute, you get many Joboutputs.

                    The Enduser do not accept to search manually every output. They request a one-shot solution.

                     

                    So, because we do not have the "Control-M Workload Archiving" under licence, the output scan via on/do with a following Mail, if keyword is found

                    is best solution for us.

                     

                    Thx to Bentze for the hint.

                     

                    Simon

                    • 7. Re: How to search multiple Job Output
                      Mark Francome

                      Hi Simon,

                       

                      Sending the output via email is probably your best alternative in this situation. There are various ways in which you can configure this, let us know if we can help.

                       

                      Regards,

                       

                      Mark.

                      • 8. Re: How to search multiple Job Output
                        Mun Keong Lee

                        Hi Simon

                        To meet your requirements of allowing user to scan through all outputs of a given job, I can think of using the Control-M automation api to achieve it. To avoid installation of additional development tools, I would suggest using powershell as it's available out of the box on Windows and it's capable of performing REST requests.

                        You will need to execute the following api in sequence:

                        1. /session/login (to login and obtain token)
                        2. /run/job/<jobId>/output?runNo=<runcount> (to get job output based on jobId and runcount)
                        3. /session/logout (to logout)

                         

                        JobId is actually <Control-M Name>:<Order ID>. Get the job's output starting from runcount 1 and increment it sequentially until error is returned indicating there's no more output. Scan the output for desired string when each output has been retrieved.

                         

                        You can even simplify execution of the powershell script by integrating it with EM client. This can done by defining External Programs (File->Options). You can pass Control-M information like Control-M, Order Id etc. to your script. Only information that cannot be obtained from the job is the username & password to login to the EM. You have to prompt for username & password in your script.

                         

                        Hope this helps.

                        Regards,

                        MK

                        2 of 2 people found this helpful