Reputation: 27
I am new to Talend os.
However, I received a task:
Till step 4 I am done.
Now the problem is:
How to Implement logging at the end of each job to report the number of leads (count of distinct id in leads table) and number of opportunities created (count of opportunity id) by stages (how many converted, qualified, closed won, and dead)?
Help would be appreciated.
Upvotes: 1
Views: 245
Reputation: 4051
You can get this data using global variables, in a subjob at the end of your job. Most components provide a global variable called tComponent_NB_LINE (or _NB_LINE_INSERTED for database components) that gives you the number of lines output by the component.
For instance tFileOutputDelimited_1_NB_LINE
or tOracleOutput_1_NB_LINE_INSERTED
.
Using these variables you can log into console or file.
Here is a simple example. If you have a tOracleOutput_1
in your job you can do:
tPostJob -- OnComponentOk -- tFixedFlowInput -- Main -- tLogRow
Inside tFixedFlowInput you retrieve the variable
(Integer)globalMap.get("tOracleOutput_1_NB_LINE_INSERTED")`.
If you need to log aggregated info, you can append a tAggregateRow
to your output components, and use tSetGlobalVar
to get count by certain criteria.
Upvotes: 1