{"id":7774,"date":"2021-03-24T23:49:56","date_gmt":"2021-03-25T03:49:56","guid":{"rendered":"https:\/\/www.redline13.com\/blog\/?p=7774"},"modified":"2022-01-20T08:46:00","modified_gmt":"2022-01-20T13:46:00","slug":"how-to-access-redline13-test-and-server-ids-from-jmeter","status":"publish","type":"post","link":"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/","title":{"rendered":"How to access RedLine13 Test and Server IDs from JMeter"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-7775 size-full\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2021\/03\/word-image-16.png\" alt=\"Visibility of test ID and server ID properties.\" width=\"787\" height=\"324\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2021\/03\/word-image-16.png 787w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2021\/03\/word-image-16-300x124.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2021\/03\/word-image-16-768x316.png 768w\" sizes=\"auto, (max-width: 787px) 100vw, 787px\" \/><\/p>\n<p>We have recently released a new feature that allows <a href=\"https:\/\/jmeter.apache.org\/\">JMeter<\/a> to access the RedLine13-assigned <em>Test ID<\/em> as well as the <em>Server ID<\/em> directly from the test plan. If you already know how JMeter exposes options set at the command line, accessing this information will be familiar. (Otherwise, you may want to refer to <a href=\"https:\/\/www.redline13.com\/blog\/2021\/03\/accessing-jmeter-properties-set-as-command-line-options\/\">this post<\/a> for some additional context.) This information will be undoubtedly useful for a variety of purposes. However, one specific example would be in conjunction with <a href=\"https:\/\/www.redline13.com\/blog\/2021\/03\/test-results-in-stunning-grafana\/\">using third-party integrations to visualize your test metrics<\/a>, as something we have covered in a previous blog post (<em>e.g.<\/em>, using <a href=\"https:\/\/www.influxdata.com\/products\/influxdb\/\">InfluxDB<\/a> and <a href=\"https:\/\/grafana.com\/\">Grafana<\/a>).<\/p>\n<p>To review the <a href=\"https:\/\/jmeter.apache.org\/usermanual\/get-started.html#options\">command line syntax<\/a> for importing JMeter custom properties, let us consider the following expression:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre><span style=\"color: #800000;\"><strong>&nbsp; &nbsp; -J[<em>prop_name<\/em>]=[<em>value<\/em>]&nbsp;<\/strong><\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Tests run through RedLine13 now internally add two properties to the JMeter command line: <span style=\"color: #800000;\"><strong>serverid<\/strong> <\/span>for the unique ID of the load agent instance, and <span style=\"color: #800000;\"><strong>testid<\/strong> <\/span>containing the sequential RedLine13 test number. This makes them accessible from JMeter test plans through a number of different ways, however the most straightforward means is using the built-in \u201c<span style=\"color: #800000;\"><strong>__P()<\/strong><\/span>\u201d function and <span style=\"color: #800000;\"><strong>${&#8230;}<\/strong><\/span> notation.<\/p>\n<p>If this fits your use case, you can enter <span style=\"color: #800000;\"><strong>${__P(rl13_serverid)}<\/strong><\/span> and <span style=\"color: #800000;\"><strong>${__P(rl13_testid)}<\/strong><\/span> into samplers, header and parameter tables, and many more places with no actual code required. An example of this can be found below, which echoes both properties to another web request:<\/p>\n<figure id=\"attachment_7776\" class=\"wp-caption alignnone\" style=\"max-width: 885px\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7776 size-full\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2021\/03\/word-image-17.png\" alt=\"\" width=\"885\" height=\"159\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2021\/03\/word-image-17.png 885w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2021\/03\/word-image-17-300x54.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2021\/03\/word-image-17-768x138.png 768w\" sizes=\"auto, (max-width: 885px) 100vw, 885px\" \/><figcaption class=\"wp-caption-text\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * should be __P(rl13_serverid), __P(rl13_testid) in the image<\/figcaption><\/figure>\n<p>In the event that you need to access these properties from within a script (<em>e.g.<\/em>, BeanShell or JSR223) the process is similar, but the notation is slightly different. Instead, use the built-in <span style=\"color: #800000;\"><strong>props<\/strong><\/span> object by invoking \u201c<span style=\"color: #800000;\"><strong>props.get(\u201crl13_serverid\u201d)<\/strong><\/span>\u201d or \u201c<span style=\"color: #800000;\"><strong>props.get(\u201crl13_testid\u201d)<\/strong><\/span>\u201d as outlined in the JMeter documentation <a href=\"https:\/\/jmeter.apache.org\/usermanual\/test_plan.html#properties\">here<\/a>. A simple example that assigns these properties to values is as follows:<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<pre><span style=\"color: #800000;\"><strong>    String __serverid = props.get(\u201crl13_serverid\u201d); <\/strong><\/span>\n\n<strong><span style=\"color: #800000;\">    String __testid = props.get(\u201crl13_testid\u201d);<\/span> <\/strong><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This is of course a basic example providing access to test and server ID properties within your test plan. If you do not already have an account, you can sign up for a free <a href=\"http:\/\/www.redline13.com\/\">RedLine13<\/a> trial subscription which will allow you to test out this feature for yourself.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have recently released a new feature that allows JMeter to access the RedLine13-assigned Test ID as well as the Server ID directly from the test plan. If you already know how JMeter exposes options set at the command line, accessing this information will be familiar. (Otherwise, you may want to refer to this post for some additional context.) This information will be undoubtedly useful for a variety of purposes. However, one specific example would be<a class=\"more-link\" href=\"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/\">Read More &rarr;<\/a><\/p>\n","protected":false},"author":11,"featured_media":7775,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,7],"tags":[169,230,283,293,392],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-dkoziel","4":"post-7774","6":"format-standard","7":"has-post-thumbnail","8":"category-blog","9":"category-jmeter","10":"post_tag-data-analysis","11":"post_tag-grafana","12":"post_tag-jmeter","13":"post_tag-jmeter-properties","14":"post_tag-performance-test-automation"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to access RedLine13 Test and Server IDs from JMeter - RedLine13<\/title>\n<meta name=\"description\" content=\"This newly released feature allows access to the test ID and server IDs from within JMeter test plan. Read about how to implement this for your load tests.\" \/>\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.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to access RedLine13 Test and Server IDs from JMeter - RedLine13\" \/>\n<meta property=\"og:description\" content=\"This newly released feature allows access to the test ID and server IDs from within JMeter test plan. Read about how to implement this for your load tests.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/\" \/>\n<meta property=\"og:site_name\" content=\"RedLine13\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-25T03:49:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-20T13:46:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2021\/03\/word-image-16.png\" \/>\n\t<meta property=\"og:image:width\" content=\"787\" \/>\n\t<meta property=\"og:image:height\" content=\"324\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"David Koziel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Koziel\" \/>\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.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/\"},\"author\":{\"name\":\"David Koziel\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\"},\"headline\":\"How to access RedLine13 Test and Server IDs from JMeter\",\"datePublished\":\"2021-03-25T03:49:56+00:00\",\"dateModified\":\"2022-01-20T13:46:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/\"},\"wordCount\":373,\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"keywords\":[\"Data Analysis\",\"grafana\",\"JMeter\",\"JMeter properties\",\"Performance test automation\"],\"articleSection\":[\"Blog\",\"JMeter\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/\",\"name\":\"How to access RedLine13 Test and Server IDs from JMeter - RedLine13\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\"},\"datePublished\":\"2021-03-25T03:49:56+00:00\",\"dateModified\":\"2022-01-20T13:46:00+00:00\",\"description\":\"This newly released feature allows access to the test ID and server IDs from within JMeter test plan. Read about how to implement this for your load tests.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.redline13.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to access RedLine13 Test and Server IDs from JMeter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"name\":\"RedLine13\",\"description\":\"(Almost) Free Load Testing in the Cloud\",\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.redline13.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\",\"name\":\"RedLine13\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"contentUrl\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"width\":300,\"height\":68,\"caption\":\"RedLine13\"},\"image\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\",\"name\":\"David Koziel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"caption\":\"David Koziel\"},\"url\":\"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to access RedLine13 Test and Server IDs from JMeter - RedLine13","description":"This newly released feature allows access to the test ID and server IDs from within JMeter test plan. Read about how to implement this for your load tests.","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.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/","og_locale":"en_US","og_type":"article","og_title":"How to access RedLine13 Test and Server IDs from JMeter - RedLine13","og_description":"This newly released feature allows access to the test ID and server IDs from within JMeter test plan. Read about how to implement this for your load tests.","og_url":"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/","og_site_name":"RedLine13","article_published_time":"2021-03-25T03:49:56+00:00","article_modified_time":"2022-01-20T13:46:00+00:00","og_image":[{"width":787,"height":324,"url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2021\/03\/word-image-16.png","type":"image\/png"}],"author":"David Koziel","twitter_card":"summary_large_image","twitter_misc":{"Written by":"David Koziel","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/#article","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/"},"author":{"name":"David Koziel","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20"},"headline":"How to access RedLine13 Test and Server IDs from JMeter","datePublished":"2021-03-25T03:49:56+00:00","dateModified":"2022-01-20T13:46:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/"},"wordCount":373,"publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"keywords":["Data Analysis","grafana","JMeter","JMeter properties","Performance test automation"],"articleSection":["Blog","JMeter"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/","url":"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/","name":"How to access RedLine13 Test and Server IDs from JMeter - RedLine13","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/#website"},"datePublished":"2021-03-25T03:49:56+00:00","dateModified":"2022-01-20T13:46:00+00:00","description":"This newly released feature allows access to the test ID and server IDs from within JMeter test plan. Read about how to implement this for your load tests.","breadcrumb":{"@id":"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.redline13.com\/blog\/2021\/03\/how-to-access-redline13-test-and-server-ids-from-jmeter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redline13.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to access RedLine13 Test and Server IDs from JMeter"}]},{"@type":"WebSite","@id":"https:\/\/www.redline13.com\/blog\/#website","url":"https:\/\/www.redline13.com\/blog\/","name":"RedLine13","description":"(Almost) Free Load Testing in the Cloud","publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.redline13.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.redline13.com\/blog\/#organization","name":"RedLine13","url":"https:\/\/www.redline13.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","contentUrl":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","width":300,"height":68,"caption":"RedLine13"},"image":{"@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20","name":"David Koziel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","caption":"David Koziel"},"url":"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/7774","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/comments?post=7774"}],"version-history":[{"count":2,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/7774\/revisions"}],"predecessor-version":[{"id":8920,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/7774\/revisions\/8920"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media\/7775"}],"wp:attachment":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media?parent=7774"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/categories?post=7774"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/tags?post=7774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}