If you want access session log of recent workflow run from machine which is not part of informatica domain then you should use infacmd GetSessionLog
command to extract logs. This command can be executed as standalone program or can be embedded in script to automate work. We will learn about this command with the help of examples.
Prerequisite
We recommend reading Informatica INFACMD Tutorial to understand below command better.
GetSessionLog - Required Options and Values
We have previously learned about how to extract infotmatica workflow logs where we had specified following options to get logs using command GetWorkflowLog
. GetSessionLog
also accepts all of these options along with an additional flag -Session
to provide name of the session for which log has to be extracted. We will revisit these options below.
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 variableINFA_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 variableINFA_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 andBin
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 asBin
.-FolderName -fn Folder name in which workflow and session resides. -Workflow -wf Name of the workflow. -Session -ss Name of the session. GetSessionLog Example
infacmd GetSessionLog -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 -Session SESSION_NAME
Above command uses plain text password to connect domain and repository which should be avoided by using an encrypted informatica domain and repository password.
GetSessionLog with Encrypted Password
You can encrypt passwords usingpmpasswd
and store them inside environment variableINFA_DEFAULT_DOMAIN_PASSWORD
(domain password) andINFA_REPOSITORY_PASSWORD
like belowINFA_DEFAULT_DOMAIN_PASSWORD="KBACAF604ekJHoTuzISGOjo=="; export INFA_DEFAULT_DOMAIN_PASSWORD INFA_REPOSITORY_PASSWORD="KBACAF604ekJHoTuzISGOjo=="; export INFA_REPOSITORY_PASSWORD infacmd GetSessionLog -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 -Session SESSION_NAME
Conclusion
In above tutorial we learn how to export session log of last workflow run from command line. We have also seen how to use encrypted password to avoid passing domain and repository password in plaintext.