Automic Workload Automation

 View Only

  • 1.  Store complete activation report into VARA

    Posted Jan 09, 2024 05:51 AM

    Hi Community,

    We are trying to store a filtered report content into the VARA but the complete report information is not storing only last line of the report is storing into the VARA. Can any one suggest how to store complete report information into VARA object?

    Below is the script which I had created:

    :SET &HND#=PREP_PROCESS_FILE(KNL-SPC-01,"E:\stdout.log","*ERROR*")
    :PROCESS &HND#
    :   SET &LINE#=GET_PROCESS_LINE(&HND#)
    :   SET &MSG# = "MESSAGE"
    :   PRINT &LINE#
    :   PUT_VAR &RESULT_REPORT#,&MSG#,&LINE#
    :ENDPROCESS

    Output:

    Thank you in advance.



    ------------------------------
    Regards,

    Eshwar
    ------------------------------


  • 2.  RE: Store complete activation report into VARA

    Posted Jan 09, 2024 06:32 AM

    Hi Eshwar,

    you are using a loop to read the text file. From the loop you're writing the lines to a VARA object using the same key "MESSAGE". So each loop overwrites the previous content.

    Solution: if you want to keep the key "MESSAGE" you'll have to add a unique loop counter, i.e. MESSAGE001, MESSAGE002 and so on.

    regards,

    Peter



    ------------------------------
    Automic Certified Professional/Expert & Broadcom Knight

    For AUTOMIC trainings please check https://www.qskills.de/qs/workshops/automic/
    ------------------------------



  • 3.  RE: Store complete activation report into VARA

    Posted Jan 09, 2024 06:48 AM

    The Key column is like a primary key and should be unique . If you try adding in the loop. the values will get overwritten.




  • 4.  RE: Store complete activation report into VARA

    Posted Jan 09, 2024 07:01 AM

    Thank you @Peter Grundler and @Dilip Dhamodharan for your reply.

    If I use MESSAGE 01, MESSAGE 02,..MESSAGE n then my code will be increases so instead of that can I store entire output in the VARA without Key also? Please suggest if there is any other option.



    ------------------------------
    Regards,

    Eshwar
    ------------------------------



  • 5.  RE: Store complete activation report into VARA

    Posted Jan 09, 2024 10:34 AM

    Hi Eshwar,

    without a key a static VARA object can only store one line. You could try using a VARA.XML object but I don't think that this will be a good alternative.

    regards,
    Peter



    ------------------------------
    Automic Certified Professional/Expert & Broadcom Knight

    For AUTOMIC trainings please check https://www.qskills.de/qs/workshops/automic/
    ------------------------------



  • 6.  RE: Store complete activation report into VARA

    Posted Jan 10, 2024 02:23 AM

    Hi Peter,

    Completely understand. So, can you please suggest me what is the best approach where I can read a file and send notification to users when there is an ERROR message in the file?

    Thank you  in advance. 



    ------------------------------
    Regards,

    Eshwar
    ------------------------------



  • 7.  RE: Store complete activation report into VARA

    Broadcom Employee
    Posted Jan 10, 2024 03:22 AM

    Hi,

    to propose a proper solution it would also be helpful to understand which process creates the file you are going to search.

    If you would like to scan a file and react on it's content I'm seeing 2 options:

    1) using OS commands to grep ('findstr') the file

    2) using a backend VARA object and specify the command to print the content of the file ('type' command for windows)

    I recommend using 1) for large files. In general I do not recommend to process huge files with Automic script commands. Use OS commands instead.

    Regards, Markus




  • 8.  RE: Store complete activation report into VARA

    Posted Jan 10, 2024 03:42 AM

    Hi Markus,

    Thank you for your suggestions.

    Yes, it is large file which is generated by application server. As you suggested, let me try find using OS commands.



    ------------------------------
    Regards,

    Eshwar
    ------------------------------