Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
SMR040
Contributor III
Contributor III

List of all standard (global) variables within Talend, such as jobName and ${TalendJob.log}

Hi team,

In my years of Talend development i keep coming across various out-of-the-box variables that can be very handy in development of Talend jobs/routes.

I would like to know if there is a list of those variables or where can i find out about them?

Examples are:

  • jobName
  • projectName
  • ${TalendJob.log}
  • etc..
Labels (3)
7 Replies
Anonymous
Not applicable

These are referenced within the documentation in connection to components, but there is no complete list of every variable available. This is largely due to the fact that they largely depend upon the job that you have built. An easy way of investigating these for a job is to....

 

  1. Look at the code tab of the design window. You will find many in here. It is always a good idea to take a look here since it gives you a more in-depth understand of how your job will work. With a bit of Java knowledge, this is invaluable.
  2. There is also the "Outline" tab (bottom left usually) which shows you each of the components you are using and each of the relevant globalMap variables that can be used there.

 

SMR040
Contributor III
Contributor III
Author

Thank you for your quick and detailed response @Richard Hall​!

 

Perhaps i can explain why i want to have such a list: the use case i am having now is that i am in the middle of a migration from 7.2 to 8, this means moving from log4j to log4j2. the issue i am facing now is with the log4j template that i used to have where i could refer to for example the jobName (and more) variable like this:

 

%X{jobName}

%X{version}

 

Now with log4j2 it does not seem to work anymore. so i was wondering if i need to refer to some other variables within Talend or that i am doing something wrong in the template.

 

Anonymous
Not applicable

Can you share your old template with us so that we can see what you're working with?

SMR040
Contributor III
Contributor III
Author

this is the old template i was using in Log4j (1):

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

 

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/' >

 

<!-- CONSOLE appender -->

<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">

   <layout class="org.apache.log4j.PatternLayout">

      <param name="ConversionPattern" value="%d | %5p | %c{1} |%X{jobInstanceId}|%X{jobName}|%X{version}| %m%n" />

   </layout>

</appender>

 

<appender name="file" class="org.apache.log4j.RollingFileAppender">

   <param name="append" value="true" />

   <param name="maxFileSize" value="10MB" />

   <param name="maxBackupIndex" value="10" />

   <param name="file" value="C:/appl/log/log.log" />

   <layout class="org.apache.log4j.PatternLayout">

   <param name="ConversionPattern"

      value="%d | %5p | %c{1} |%X{jobInstanceId}|%X{jobName}|%X{version}| %m%n" />

   </layout>

</appender>

 

 

   <root>

      <level value="INFO" />

      <appender-ref ref="file" />

   </root>

 

</log4j:configuration>

Anonymous
Not applicable

Ah, I see. I think I misunderstood. So you have been using MDC to set up the %X variables. Are you using the Enterprise Edition of Talend or an Open Studio version? Did you have a third party come and implement this? The %X variables are not standard.

SMR040
Contributor III
Contributor III
Author

We are using the Enterprise Edition (Talend Data Services Platform). The implementation was done before i arrived at this project so the exact origination i dont know. but what i do know is that it used to work perfectly and since we moved to log4j2 it has not been working anymore.

 

do you have any suggestions to restore that functionality?

Anonymous
Not applicable

I'm afraid that I have not done a great deal with MDC (Mapped Diagnostic Context) for Log4j and it is not part of the standard product. I have also asked a few colleagues whether they have implemented anything similar and so far I have not had "yes" back. I may not be talking to the correct people, so I will keep asking.

 

In the meantime, I have found this tutorial which may help you....

 

https://www.baeldung.com/mdc-in-log4j-2-logback

 

My recommendation would be that you see if you can find who implemented this and see if they have an upgrade. If this was a Talend Professional Services consultant who created this, if you can find out who or when it was done (and give me account details....via a message here rather than in the main forum), I will get in contact with the individual and see whether they can help.