
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2019 09:31 AM
Good day, all.
I have a table of JMS Connections that includes several columns of info. One column in particular has URL-like data (meaning it contains a host, port, and some garbage I do not want) in it that I would like to parse into two additional columns (one for host and one for port) using the Transform Table operation.
I have attempted to use an EVAL statement (below) to attempt to extract the host, but it is giving me an "Illegal group reference." error.
EVAL(javascript:var rtrn = ''; var regex = /(?<=\/\/)(.*)(?=:)/; var jms_host = ${$JMSConnections[*].extProviderURL}; rtrn = regex.exec(jms_host);)
Here is a sample table of data:
extProviderURL | jndiName | type | forEach |
jmsnaming://serverA.com:1234 | TibcoABC123 | QUEUE | /opt/WebSphere/.../resources.xml |
jmsnaming://serverA.com:1234 | TibcoABC321 | QUEUE | /opt/WebSphere/.../resources.xml |
jmsnaming://serverB.com:1234 | TibcoABC789 | QUEUE | /opt/WebSphere/.../resources.xml |
jmsnaming://serverB.com:1234 | TibcoABC987 | QUEUE | /opt/WebSphere/.../resources.xml |
And here is what I would want to see:
extProviderURL | jndiName | type | jms_host | forEach |
jmsnaming://serverA.com:1234 | TibcoABC123 | QUEUE | serverA.com | /opt/WebSphere/.../resources.xml |
jmsnaming://serverA.com:1234 | TibcoABC321 | QUEUE | serverA.com | /opt/WebSphere/.../resources.xml |
jmsnaming://serverB.com:1234 | TibcoABC789 | QUEUE | serverB.com | /opt/WebSphere/.../resources.xml |
jmsnaming://serverB.com:1234 | TibcoABC987 | QUEUE | serverB.com | /opt/WebSphere/.../resources.xml |
Anyone have any ideas on how to do this?
Thanks!
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2020 01:37 AM
Use Transform Table operation, source and target table will be same and in fieldname provide jms_hostname, value will be eval script. try below script
var rtrn = '';
var data = ${table_name[].extProviderURL};
var match = /.*\/\/(.*):.*/.exec(data);
if(match){
interfaceName = match[1];
}
rtrn;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2020 01:37 AM
Use Transform Table operation, source and target table will be same and in fieldname provide jms_hostname, value will be eval script. try below script
var rtrn = '';
var data = ${table_name[].extProviderURL};
var match = /.*\/\/(.*):.*/.exec(data);
if(match){
interfaceName = match[1];
}
rtrn;