If you want to access log file of recent workflow run from repository using command line or script then you can make use of informatica's command line utility called infacmd just like pmrep and pmcmd. Infacmd supports command GetWorkflowLog
which allows you to export workflow logs from repository. This is useful especially when you want to download logs from outside machine which is not part of information domain. In this article we will demonstrate this command with help of example.
Prerequisite
Before proceeding with this tutorial quickly familiarize yourself about infacmd and how secure execution works with infacmd.
GetWorkflowLog - Required Options and Values
Flag | Alias | Explanation |
---|---|---|
-Gateway | -hp | Informatica gateway hostname and port where services are running separated by colon. ( example.com:8888 ). |
-DomainName | -dn | Informatica domain name where workflow ran. |
-UserName | -un | Domain username of informatica user using which command will be executed. (Generally same as repository username) |
-Password | -pd | Password of the domain user in plain text. This flag is not needed if encrypted domain password is set in an environment variable INFA_DEFAULT_DOMAIN_PASSWORD .(Generally domain password is same as repository password) |
-IntegrationService | -is | Name of the integration service where workflow ran in given domain. |
-RepositoryService | -rs | Name of the repository service where workflow ran in given domain. |
-RepositoryUser | -ru | Repository username of informatica user using which command will be executed. |
-RepositoryPassword | -ru | Password of the repository user in plain text. This flag is not needed if encrypted repository password is set in an environment variable INFA_REPOSITORY_PASSWORD . |
-Format | -fm | File format with which log file has to be exported. It supports 3 values. Text to export logs in text format, XML to export logs in xml format and Bin to export logs as binary blob | -OutputFile | -o | Name for the output log file which has to be exported. This parameter is compulsory if file format is specified as Bin . | -FolderName | -fn | Folder name in which workflow resides. |
-Workflow | -wf | Name of the workflow. |
GetWorkflowLog Example
infacmd GetWorkflowLog -Gateway example.com:8888 -DomainName MY_DOMAIN
-UserName DOMAIN_USERNAME -Password MyStr0ngP#d
-IntegrationService MY_INT_SERVICE -RepositoryService MY_REP_SERVICE
-RepositoryUser REP_USERNAME -RepositoryPassword MyStr0ngP#d
-Format TEXT-OutputFile workflow_name.log -FolderName FOLDER_NAME
-Workflow WORKFLOW_NAME
GetWorkflowLog with Encrypted Password
Note that we have encrypted informatica domain and repository password using pmpasswd
and stored them inside environment variable INFA_DEFAULT_DOMAIN_PASSWORD
and INFA_REPOSITORY_PASSWORD
respectively. Hence we need not to provide password in plain text like in above insecure command execution.
INFA_DEFAULT_DOMAIN_PASSWORD="KBACAF604ekJHoTuzISGOjo==";
export INFA_DEFAULT_DOMAIN_PASSWORD
INFA_REPOSITORY_PASSWORD="KBACAF604ekJHoTuzISGOjo==";
export INFA_REPOSITORY_PASSWORD
infacmd GetWorkflowLog -Gateway example.com:8888 -DomainName MY_DOMAIN
-UserName DOMAIN_USERNAME
-IntegrationService MY_INT_SERVICE -RepositoryService MY_REP_SERVICE
-RepositoryUser REP_USERNAME
-Format TEXT -OutputFile -FolderName FOLDER_NAME
-Workflow WORKFLOW_NAME
Conclusion
We have learned how to fetch log file of latest workflow run from informatica repository. We have also learned how to securely execute the command and avoid password input in plaintext. In the next tutorial we will learn how to get session log using similar approach.