{"id":3142,"date":"2013-06-06T04:23:00","date_gmt":"2013-06-06T02:23:00","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/"},"modified":"2013-06-06T04:23:00","modified_gmt":"2013-06-06T02:23:00","slug":"weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/","title":{"rendered":"WebLogic: Using a WLST script to find a specific word in an object"},"content":{"rendered":"<p>On a WebLogic Server, I had to write a WLST script to find the current number of consumers accessing a specific JMS Queue destination as this is not monitored by Oracle Grid Control 11g or Oracle Cloud Control 12c. Knowing only the short name of the queue, I uses a regular expression in my WLST script to find the needed information.<\/p>\n<p>To find the correct queue destination I had to search the Queue Destination Name. But in the Runtime tree, the fully-qualified name of this queue resource is preceded by the parent module name, separated by an exclamation point (!) (e.g DocumentApplicationJMSSystemModule!SOAReqMSQ). So how can I find an object using the short name SOAReqMSQ?<\/p>\n<h3>Finding the object via WLST script<\/h3>\n<p>To achieve this task, you have to:<\/p>\n<p><strong>Step 1<\/strong>: Use a regular expression by adding in your WLST script:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">import re<\/pre>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>Step 2<\/strong>: Use the primitive operation:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">re.search(pattern, string[, flags])<\/pre>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>Step 3<\/strong>: Search only for the defined word and not more:<\/p>\n<p>If you search for SOAReqMSQ using&#8230;<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">cQueueName='SOAReqMSQ'\nresult = re.search(cQueueName,destination.getName());\n...the result will be:\nDocumentApplicationJMSSystemModule!SOAReqMSQDocumentApplicationJMSSystemModule!SOAReqMSQ_ErrorQ\n\u00a0To find the correct one,\u00a0use the $ to match the end of the string\ncQueueName='SOAReqMSQ$'\nresult = re.search(cQueueName,destination.getName());<\/pre>\n<p>This way, DocumentApplicationJMSSystemModule!SOAReqMSQ may be found.<\/p>\n<p><strong>Step 4<\/strong>: In the end, your script should look similar to this (the important information related to the search issue is underlined):<\/p>\n<p style=\"padding-left: 30px\"><span style=\"text-decoration: underline\"><code>import re<\/code><\/span><\/p>\n<p style=\"padding-left: 30px\"><code style=\"padding-left: 30px\"><br \/>\n# check queue name<br \/>\ncQueueName=<span style=\"text-decoration: underline\">'SOAReqMSQ$'<\/span><\/code><\/p>\n<p style=\"padding-left: 30px\"><code style=\"padding-left: 30px\"><br \/>\n#\u00a0check only the queue for the Managed Server Name containing soa01<br \/>\ncServer='soa01'<\/code><\/p>\n<p style=\"padding-left: 30px\"><code>connect(userConfigFile='\/opt\/user_projects\/domains\/testdomain\/security\/uc',userKeyFile='\/opt\/user_projects\/domains\/testdomain\/security\/uk',url='t3:\/\/testhost:8101')<\/code><code><\/code><\/p>\n<p style=\"padding-left: 30px\"><code># get server list<br \/>\nservers = domainRuntimeService.getServerRuntimes();<\/code><\/p>\n<p style=\"padding-left: 30px\"><code><\/code><code>if (len(servers) &gt; 0):<br \/>\nfor server in servers:<br \/>\n# find if ServerName contains soa01<br \/>\nresult = <span style=\"text-decoration: underline\">re.search(cServer,server.getName());<\/span><br \/>\nif result != None:<br \/>\njmsRuntime = server.getJMSRuntime();<br \/>\njmsServers = jmsRuntime.getJMSServers();<br \/>\njmsName = jmsRuntime.getName();<br \/>\nprint 'n';<br \/>\nprint 'Name',jmsName;<br \/>\nprint '----------------------------';<br \/>\nfor jmsServer in jmsServers:<br \/>\ndestinations = jmsServer.getDestinations();<br \/>\nfor destination in destinations:<br \/>\nresult = <span style=\"text-decoration: underline\">re.search(cQueueName,destination.getName());<\/span><br \/>\nif result != None:<br \/>\nprint 'DESTINATION:',destination.getName();<br \/>\nprint 'JMS Server:',jmsServer.getName();<br \/>\nprint 'ConsumersCurrentCount:',destination.getConsumersCurrentCount()<\/code><\/p>\n<p><strong>Step 5<\/strong>: Here is the script output:<\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">Name testdomainsoa01.jms\n----------------------------\nDESTINATION: DocumentApplicationJMSSystemModule!SOAReqMSQ\nJMS Server: DocumentApplicationJMSServer\nConsumersCurrentCount: 0<\/pre>\n<p>This python script can be then called by a shell script that will be integrated, for instance, as a UDM script in Grid Control 11g.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On a WebLogic Server, I had to write a WLST script to find the current number of consumers accessing a specific JMS Queue destination as this is not monitored by Oracle Grid Control 11g or Oracle Cloud Control 12c. Knowing only the short name of the queue, I uses a regular expression in my WLST [&hellip;]<\/p>\n","protected":false},"author":24,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[334,143,218,307,380],"type_dbi":[],"class_list":["post-3142","post","type-post","status-publish","format-standard","hentry","category-application-integration-middleware","tag-middleware","tag-monitoring","tag-oracle-enterprise-manager-cloud-12c","tag-oracle-weblogic","tag-wlst"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>WebLogic: Using a WLST script to find a specific word in an object - dbi Blog<\/title>\n<meta name=\"description\" content=\"On a WebLogic Server, I had to write a WLST script to find the current number of consumers accessing a specific JMS Queue destination as this is not monitored by Oracle Grid Control 11g or Oracle Cloud Control 12c. Knowing only the short name of the queue, I uses a regular expression in my WLST script to find the needed information.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WebLogic: Using a WLST script to find a specific word in an object\" \/>\n<meta property=\"og:description\" content=\"On a WebLogic Server, I had to write a WLST script to find the current number of consumers accessing a specific JMS Queue destination as this is not monitored by Oracle Grid Control 11g or Oracle Cloud Control 12c. Knowing only the short name of the queue, I uses a regular expression in my WLST script to find the needed information.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2013-06-06T02:23:00+00:00\" \/>\n<meta name=\"author\" content=\"G\u00e9rard Wisson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"G\u00e9rard Wisson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/\"},\"author\":{\"name\":\"G\u00e9rard Wisson\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/ad54b5e621903122c00c6b7921c6ab85\"},\"headline\":\"WebLogic: Using a WLST script to find a specific word in an object\",\"datePublished\":\"2013-06-06T02:23:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/\"},\"wordCount\":232,\"commentCount\":0,\"keywords\":[\"Middleware\",\"Monitoring\",\"Oracle Enterprise Manager Cloud 12c\",\"Oracle WebLogic\",\"WLST\"],\"articleSection\":[\"Application integration &amp; Middleware\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/\",\"name\":\"WebLogic: Using a WLST script to find a specific word in an object - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2013-06-06T02:23:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/ad54b5e621903122c00c6b7921c6ab85\"},\"description\":\"On a WebLogic Server, I had to write a WLST script to find the current number of consumers accessing a specific JMS Queue destination as this is not monitored by Oracle Grid Control 11g or Oracle Cloud Control 12c. Knowing only the short name of the queue, I uses a regular expression in my WLST script to find the needed information.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WebLogic: Using a WLST script to find a specific word in an object\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/ad54b5e621903122c00c6b7921c6ab85\",\"name\":\"G\u00e9rard Wisson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/1eb607e2c436690f1f57c55db47a3fabb0d11955ea9a2510605d5e5813632408?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1eb607e2c436690f1f57c55db47a3fabb0d11955ea9a2510605d5e5813632408?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1eb607e2c436690f1f57c55db47a3fabb0d11955ea9a2510605d5e5813632408?s=96&d=mm&r=g\",\"caption\":\"G\u00e9rard Wisson\"},\"description\":\"G\u00e9rard Wisson has more than ten years of experience in Enterprise Content Management (ECM) with Documentum as well as in Oracle WebLogic and Java EE \/ J2EE infrastructures. He is specialized in ECM infrastructure services such as installation, upgrade, high availability, and administration as well as in Oracle WebLogic services such as installation, configuration, and management. He is very experienced in the monitoring and optimization of Java EE \/ J2EE infrastructures with Grid\/Cloud Control and JVMD. G\u00e9rard Wisson is certified Oracle Weblogic Server 11g System Administrator and Oracle Certified Associate. Prior to joining dbi services, G\u00e9rard Wisson was Senior Consultant at Solfit in Basel. He holds a diploma in Electrical Engineering from the University of Strasbourg (F). His branch-related experience covers Financial Services \/ Banking, Chemicals &amp; Pharmaceuticals, etc.\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/gerard-wisson\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"WebLogic: Using a WLST script to find a specific word in an object - dbi Blog","description":"On a WebLogic Server, I had to write a WLST script to find the current number of consumers accessing a specific JMS Queue destination as this is not monitored by Oracle Grid Control 11g or Oracle Cloud Control 12c. Knowing only the short name of the queue, I uses a regular expression in my WLST script to find the needed information.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/","og_locale":"en_US","og_type":"article","og_title":"WebLogic: Using a WLST script to find a specific word in an object","og_description":"On a WebLogic Server, I had to write a WLST script to find the current number of consumers accessing a specific JMS Queue destination as this is not monitored by Oracle Grid Control 11g or Oracle Cloud Control 12c. Knowing only the short name of the queue, I uses a regular expression in my WLST script to find the needed information.","og_url":"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/","og_site_name":"dbi Blog","article_published_time":"2013-06-06T02:23:00+00:00","author":"G\u00e9rard Wisson","twitter_card":"summary_large_image","twitter_misc":{"Written by":"G\u00e9rard Wisson","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/"},"author":{"name":"G\u00e9rard Wisson","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/ad54b5e621903122c00c6b7921c6ab85"},"headline":"WebLogic: Using a WLST script to find a specific word in an object","datePublished":"2013-06-06T02:23:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/"},"wordCount":232,"commentCount":0,"keywords":["Middleware","Monitoring","Oracle Enterprise Manager Cloud 12c","Oracle WebLogic","WLST"],"articleSection":["Application integration &amp; Middleware"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/","url":"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/","name":"WebLogic: Using a WLST script to find a specific word in an object - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2013-06-06T02:23:00+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/ad54b5e621903122c00c6b7921c6ab85"},"description":"On a WebLogic Server, I had to write a WLST script to find the current number of consumers accessing a specific JMS Queue destination as this is not monitored by Oracle Grid Control 11g or Oracle Cloud Control 12c. Knowing only the short name of the queue, I uses a regular expression in my WLST script to find the needed information.","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/weblogic-using-a-wlst-script-to-find-a-specific-word-in-an-object\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"WebLogic: Using a WLST script to find a specific word in an object"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/ad54b5e621903122c00c6b7921c6ab85","name":"G\u00e9rard Wisson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1eb607e2c436690f1f57c55db47a3fabb0d11955ea9a2510605d5e5813632408?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1eb607e2c436690f1f57c55db47a3fabb0d11955ea9a2510605d5e5813632408?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1eb607e2c436690f1f57c55db47a3fabb0d11955ea9a2510605d5e5813632408?s=96&d=mm&r=g","caption":"G\u00e9rard Wisson"},"description":"G\u00e9rard Wisson has more than ten years of experience in Enterprise Content Management (ECM) with Documentum as well as in Oracle WebLogic and Java EE \/ J2EE infrastructures. He is specialized in ECM infrastructure services such as installation, upgrade, high availability, and administration as well as in Oracle WebLogic services such as installation, configuration, and management. He is very experienced in the monitoring and optimization of Java EE \/ J2EE infrastructures with Grid\/Cloud Control and JVMD. G\u00e9rard Wisson is certified Oracle Weblogic Server 11g System Administrator and Oracle Certified Associate. Prior to joining dbi services, G\u00e9rard Wisson was Senior Consultant at Solfit in Basel. He holds a diploma in Electrical Engineering from the University of Strasbourg (F). His branch-related experience covers Financial Services \/ Banking, Chemicals &amp; Pharmaceuticals, etc.","url":"https:\/\/www.dbi-services.com\/blog\/author\/gerard-wisson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/3142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=3142"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/3142\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=3142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=3142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=3142"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=3142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}