Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to capture UserName of Talend Studio

Hello,

 

I have requirement wherein I have to capture Talend username in a String variable / input_row(tJavaRow) which will be passed further in a table (Mysql) for logging purpose, to identify job was executed from whose machine.

 

Any idea on how we can achieve this in Talend?

Labels (3)
1 Solution

Accepted Solutions
iamabhishek
Creator III
Creator III

In your tJavaRow code you could put either of the code block to get the current Windows User Name -

String userName = System.getProperty("user.name");
System.out.println(userName);
com.sun.security.auth.module.NTSystem NTSystem = new com.sun.security.auth.module.NTSystem();
userName = NTSystem.getName();
System.out.println(userName);

View solution in original post

2 Replies
iamabhishek
Creator III
Creator III

In your tJavaRow code you could put either of the code block to get the current Windows User Name -

String userName = System.getProperty("user.name");
System.out.println(userName);
com.sun.security.auth.module.NTSystem NTSystem = new com.sun.security.auth.module.NTSystem();
userName = NTSystem.getName();
System.out.println(userName);
Anonymous
Not applicable
Author

It worked, Thanks Abhishek!