# Request attributes: Pick a value from comma separated values

**URL:** <https://community.dynatrace.com/t/request-attributes-pick-a-value-from-comma-separated-values/55983>\
**Category:** Open Q&A\
**Tags:** distributed-tracing, request-attributes\
**Created:** [May 21, 2026, 3:53pm UTC](https://community.dynatrace.com/t/request-attributes-pick-a-value-from-comma-separated-values/55983 "2026-05-21T15:53:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashik\_h2k](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@ashik\_h2k](https://community.dynatrace.com/u/ashik_h2k)\
**Post date:** [May 21, 2026, 3:53pm UTC](https://community.dynatrace.com/t/request-attributes-pick-a-value-from-comma-separated-values/55983/1 "2026-05-21T15:53:35Z")

</div>

Currently In Distributed Tracing, I can see the value as below, under Request attributes, using the below mentioned payload.  
1. [key1,key2,key3] when “argumentIndex”: 1  
2. [value1,value2,value3] when “argumentIndex”: 2

Please advise on how I can get the value of “Request-attributes-1” as only “value2”?

```auto
{
"name": "Request-attributes-1",
"enabled": true,
"dataType": "STRING",
"dataSources": [
{
"enabled": true,
"source": "METHOD_PARAM",
"technology": "JAVA",
"methods": [
{
"method": {
"visibility": "PUBLIC",
"modifiers": [
"ABSTRACT"
],
"className": "javax.class1.class2",
"methodName": "setAttribute",
"argumentTypes": [
"java.lang.String",
"java.lang.Object"
],
"returnType": "void"
},
"capture": "ARGUMENT",
"argumentIndex": X,
"deepObjectAccess": "toString().trim()"
}
]
}
],
"normalization": "ORIGINAL",
"aggregation": "ALL_DISTINCT_VALUES",
"confidential": false,
"skipPersonalDataMasking": false
}

```

---

<div class="post-metadata">

**Author:** ![sujit\_k\_singh](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@sujit\_k\_singh](https://community.dynatrace.com/u/sujit_k_singh)\
**Post date:** [May 25, 2026, 11:28am UTC](https://community.dynatrace.com/t/request-attributes-pick-a-value-from-comma-separated-values/55983/2 "2026-05-25T11:28:41Z")

</div>

Hi&nbsp;[@ashik\_h2k](https://community.dynatrace.com/user/81455)

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”.

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.

Add valueCondition and conditionArgumentIndex to your payload:

{  
“name”: “Request-attributes-1”,  
“enabled”: true,  
“dataType”: “STRING”,  
“dataSources”: [  
{  
“enabled”: true,  
“source”: “METHOD\_PARAM”,  
“technology”: “JAVA”,  
“methods”: [  
{  
“method”: {  
“visibility”: “PUBLIC”,  
“modifiers”: [“ABSTRACT”],  
“className”: “javax.class1.class2”,  
“methodName”: “setAttribute”,  
“argumentTypes”: [“java.lang.String”, “java.lang.Object”],  
“returnType”: “void”  
},  
“capture”: “ARGUMENT”,  
“argumentIndex”: 2,  
“deepObjectAccess”: “toString().trim()”  
}  
],  
“valueCondition”: {  
“negate”: false,  
“operator”: “EQUALS”,  
“value”: “key2”  
},  
“scope”: {  
“tagOfProcessGroup”: null  
},  
“parameterName”: “key2”,  
“conditionSource”: “METHOD\_PARAM”,  
“conditionArgumentIndex”: 1  
}  
],  
“normalization”: “ORIGINAL”,  
“aggregation”: “FIRST”,  
“confidential”: false,  
“skipPersonalDataMasking”: false  
}

This way you’ll only get “value2” when the key is “key2”.

Thanks,

Sujit

---

<div class="post-metadata">

**Author:** ![ashik\_h2k](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@ashik\_h2k](https://community.dynatrace.com/u/ashik_h2k)\
**Post date:** [May 26, 2026, 9:45am UTC](https://community.dynatrace.com/t/request-attributes-pick-a-value-from-comma-separated-values/55983/3 "2026-05-26T09:45:45Z")

</div>

Thanks&nbsp;[@sujit\_k\_singh](https://community.dynatrace.com/user/67382)&nbsp;, I get the following error

{  
“error”: {  
“code”: 400,  
“message”: “Constraints violated.”,  
“constraintViolations”: [  
{  
“path”: “dataSources[0].parameterName”,  
“message”: “Incompatible with attribute type.”,  
“parameterLocation”: “PAYLOAD\_BODY”,  
“location”: null  
}  
]  
}  
}

When I look at&nbsp;[Request attributes API - POST a request attribute — Dynatrace Docs](https://docs.dynatrace.com/docs/dynatrace-api/configuration-api/service-api/request-attributes-api/post-request-attribute#openapi-definition-MethodReference), it is mentioned parameterName&nbsp;Required if the **source** is one of the following: POST\_PARAMETER, GET\_PARAMETER, REQUEST\_HEADER, RESPONSE\_HEADER, CUSTOM\_ATTRIBUTE, but&nbsp;parameterName is&nbsp;METHOD\_PARAM in the above case.

---

<div class="post-metadata">

**Author:** ![sujit\_k\_singh](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@sujit\_k\_singh](https://community.dynatrace.com/u/sujit_k_singh)\
**Post date:** [May 26, 2026, 9:38pm UTC](https://community.dynatrace.com/t/request-attributes-pick-a-value-from-comma-separated-values/55983/4 "2026-05-26T21:38:46Z")

</div>

Hi&nbsp;[@ashik\_h2k](https://community.dynatrace.com/user/81455)

Ahhh .. my bad, right — parameterName is incompatible with METHOD\_PARAM source type. That field is only valid for POST\_PARAMETER, GET\_PARAMETER, REQUEST\_HEADER, RESPONSE\_HEADER, or CUSTOM\_ATTRIBUTE sources.

Simply remove the “parameterName”: “key2” line from the payload. The filtering is handled entirely by valueCondition + conditionArgumentIndex. Here’s the corrected version:

{  
“name”: “Request-attributes-1”,  
“enabled”: true,  
“dataType”: “STRING”,  
“dataSources”: [  
{  
“enabled”: true,  
“source”: “METHOD\_PARAM”,  
“technology”: “JAVA”,  
“methods”: [  
{  
“method”: {  
“visibility”: “PUBLIC”,  
“modifiers”: [“ABSTRACT”],  
“className”: “javax.class1.class2”,  
“methodName”: “setAttribute”,  
“argumentTypes”: [“java.lang.String”, “java.lang.Object”],  
“returnType”: “void”  
},  
“capture”: “ARGUMENT”,  
“argumentIndex”: 2,  
“deepObjectAccess”: “toString().trim()”  
}  
],  
“valueCondition”: {  
“negate”: false,  
“operator”: “EQUALS”,  
“value”: “key2”  
},  
“scope”: {  
“tagOfProcessGroup”: null  
},  
“conditionSource”: “METHOD\_PARAM”,  
“conditionArgumentIndex”: 1  
}  
],  
“normalization”: “ORIGINAL”,  
“aggregation”: “FIRST”,  
“confidential”: false,  
“skipPersonalDataMasking”: false  
}

The parameterName field was the culprit causing the 400 error. Removing it should resolve the constraint violation.

Thanks,

Sujit
