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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

change context based on server name

Hi, 

 

I have a requirement, where I have context defined for three servers. 

 

Server1-contextgroup1

Server2-contextgroup2

Server3- contextgroup3

 

How can I configure the job to run in such a way , that it selects the context group based on the server it is running. Or change the context group based on the server name after the job is started.

 

Thanks

Labels (3)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

hi,

 

you can check computer name with

java.net.InetAddress.getLocalHost().getHostName()

also you can check any OS variables with

System.getenv("env_name")

as variant you can check variable and run subjob with context group based on variable (host) name

 

but more simple - load context from file/database

in this case you will need only 1 context group for any number of servers, you can use same file name, or use variable name as part of context file or as part of sql query for extract and load proper context

 

View solution in original post

1 Reply
vapukov
Master II
Master II

hi,

 

you can check computer name with

java.net.InetAddress.getLocalHost().getHostName()

also you can check any OS variables with

System.getenv("env_name")

as variant you can check variable and run subjob with context group based on variable (host) name

 

but more simple - load context from file/database

in this case you will need only 1 context group for any number of servers, you can use same file name, or use variable name as part of context file or as part of sql query for extract and load proper context