<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Request attributes: Pick a value from comma separated values in Open Q&amp;A</title>
    <link>https://community.dynatrace.com/t5/Open-Q-A/Request-attributes-Pick-a-value-from-comma-separated-values/m-p/299904#M39088</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/81455"&gt;@ashik_h2k&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The setAttribute(String key, Object value) method takes the key as argument 1 and value as argument 2. The issue is that with argumentIndex: 2 you're capturing all values from every setAttribute call, not just the one where key = "key2".&lt;/P&gt;&lt;P&gt;You need to add a condition on your data source so it only captures argument 2 (value) when argument 1 (key) matches your desired key.&lt;/P&gt;&lt;P&gt;Add valueCondition and conditionArgumentIndex to your payload:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"name": "Request-attributes-1",&lt;BR /&gt;"enabled": true,&lt;BR /&gt;"dataType": "STRING",&lt;BR /&gt;"dataSources": [&lt;BR /&gt;{&lt;BR /&gt;"enabled": true,&lt;BR /&gt;"source": "METHOD_PARAM",&lt;BR /&gt;"technology": "JAVA",&lt;BR /&gt;"methods": [&lt;BR /&gt;{&lt;BR /&gt;"method": {&lt;BR /&gt;"visibility": "PUBLIC",&lt;BR /&gt;"modifiers": ["ABSTRACT"],&lt;BR /&gt;"className": "javax.class1.class2",&lt;BR /&gt;"methodName": "setAttribute",&lt;BR /&gt;"argumentTypes": ["java.lang.String", "java.lang.Object"],&lt;BR /&gt;"returnType": "void"&lt;BR /&gt;},&lt;BR /&gt;"capture": "ARGUMENT",&lt;BR /&gt;"argumentIndex": 2,&lt;BR /&gt;"deepObjectAccess": "toString().trim()"&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"valueCondition": {&lt;BR /&gt;"negate": false,&lt;BR /&gt;"operator": "EQUALS",&lt;BR /&gt;"value": "key2"&lt;BR /&gt;},&lt;BR /&gt;"scope": {&lt;BR /&gt;"tagOfProcessGroup": null&lt;BR /&gt;},&lt;BR /&gt;"parameterName": "key2",&lt;BR /&gt;"conditionSource": "METHOD_PARAM",&lt;BR /&gt;"conditionArgumentIndex": 1&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"normalization": "ORIGINAL",&lt;BR /&gt;"aggregation": "FIRST",&lt;BR /&gt;"confidential": false,&lt;BR /&gt;"skipPersonalDataMasking": false&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This way you'll only get "value2" when the key is "key2".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sujit&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 May 2026 11:28:41 GMT</pubDate>
    <dc:creator>sujit_k_singh</dc:creator>
    <dc:date>2026-05-25T11:28:41Z</dc:date>
    <item>
      <title>Request attributes: Pick a value from comma separated values</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Request-attributes-Pick-a-value-from-comma-separated-values/m-p/299861#M39076</link>
      <description>&lt;P&gt;Currently In Distributed Tracing, I can see the value as below, under&amp;nbsp;&lt;SPAN&gt;Request attributes, using the below mentioned payload.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;1. [key1,key2,key3] when&amp;nbsp;"argumentIndex": 1&lt;BR /&gt;2. [value1,value2,value3]&amp;nbsp;when&amp;nbsp;"argumentIndex": 2&lt;/P&gt;&lt;P&gt;Please advise on how I can get the value of&amp;nbsp;"&lt;SPAN&gt;Request-attributes-1&lt;/SPAN&gt;" as only "value2"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;{&lt;BR /&gt;"name": "&lt;SPAN&gt;Request-attributes-1&lt;/SPAN&gt;",&lt;BR /&gt;"enabled": true,&lt;BR /&gt;"dataType": "STRING",&lt;BR /&gt;"dataSources": [&lt;BR /&gt;{&lt;BR /&gt;"enabled": true,&lt;BR /&gt;"source": "METHOD_PARAM",&lt;BR /&gt;"technology": "JAVA",&lt;BR /&gt;"methods": [&lt;BR /&gt;{&lt;BR /&gt;"method": {&lt;BR /&gt;"visibility": "PUBLIC",&lt;BR /&gt;"modifiers": [&lt;BR /&gt;"ABSTRACT"&lt;BR /&gt;],&lt;BR /&gt;"className": "javax.class1.class2",&lt;BR /&gt;"methodName": "setAttribute",&lt;BR /&gt;"argumentTypes": [&lt;BR /&gt;"java.lang.String",&lt;BR /&gt;"java.lang.Object"&lt;BR /&gt;],&lt;BR /&gt;"returnType": "void"&lt;BR /&gt;},&lt;BR /&gt;"capture": "ARGUMENT",&lt;BR /&gt;"argumentIndex": X,&lt;BR /&gt;"deepObjectAccess": "toString().trim()"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"normalization": "ORIGINAL",&lt;BR /&gt;"aggregation": "ALL_DISTINCT_VALUES",&lt;BR /&gt;"confidential": false,&lt;BR /&gt;"skipPersonalDataMasking": false&lt;BR /&gt;}&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 May 2026 15:53:35 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Request-attributes-Pick-a-value-from-comma-separated-values/m-p/299861#M39076</guid>
      <dc:creator>ashik_h2k</dc:creator>
      <dc:date>2026-05-21T15:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Request attributes: Pick a value from comma separated values</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Request-attributes-Pick-a-value-from-comma-separated-values/m-p/299904#M39088</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/81455"&gt;@ashik_h2k&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The setAttribute(String key, Object value) method takes the key as argument 1 and value as argument 2. The issue is that with argumentIndex: 2 you're capturing all values from every setAttribute call, not just the one where key = "key2".&lt;/P&gt;&lt;P&gt;You need to add a condition on your data source so it only captures argument 2 (value) when argument 1 (key) matches your desired key.&lt;/P&gt;&lt;P&gt;Add valueCondition and conditionArgumentIndex to your payload:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"name": "Request-attributes-1",&lt;BR /&gt;"enabled": true,&lt;BR /&gt;"dataType": "STRING",&lt;BR /&gt;"dataSources": [&lt;BR /&gt;{&lt;BR /&gt;"enabled": true,&lt;BR /&gt;"source": "METHOD_PARAM",&lt;BR /&gt;"technology": "JAVA",&lt;BR /&gt;"methods": [&lt;BR /&gt;{&lt;BR /&gt;"method": {&lt;BR /&gt;"visibility": "PUBLIC",&lt;BR /&gt;"modifiers": ["ABSTRACT"],&lt;BR /&gt;"className": "javax.class1.class2",&lt;BR /&gt;"methodName": "setAttribute",&lt;BR /&gt;"argumentTypes": ["java.lang.String", "java.lang.Object"],&lt;BR /&gt;"returnType": "void"&lt;BR /&gt;},&lt;BR /&gt;"capture": "ARGUMENT",&lt;BR /&gt;"argumentIndex": 2,&lt;BR /&gt;"deepObjectAccess": "toString().trim()"&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"valueCondition": {&lt;BR /&gt;"negate": false,&lt;BR /&gt;"operator": "EQUALS",&lt;BR /&gt;"value": "key2"&lt;BR /&gt;},&lt;BR /&gt;"scope": {&lt;BR /&gt;"tagOfProcessGroup": null&lt;BR /&gt;},&lt;BR /&gt;"parameterName": "key2",&lt;BR /&gt;"conditionSource": "METHOD_PARAM",&lt;BR /&gt;"conditionArgumentIndex": 1&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"normalization": "ORIGINAL",&lt;BR /&gt;"aggregation": "FIRST",&lt;BR /&gt;"confidential": false,&lt;BR /&gt;"skipPersonalDataMasking": false&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This way you'll only get "value2" when the key is "key2".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sujit&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2026 11:28:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Request-attributes-Pick-a-value-from-comma-separated-values/m-p/299904#M39088</guid>
      <dc:creator>sujit_k_singh</dc:creator>
      <dc:date>2026-05-25T11:28:41Z</dc:date>
    </item>
  </channel>
</rss>

