<?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 Has anyone had luck using HTTP_REQUEST_METHOD in a Global Web Request Naming rule Placeholder? in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Has-anyone-had-luck-using-HTTP-REQUEST-METHOD-in-a-Global-Web/m-p/202137#M2255</link>
    <description>&lt;P&gt;I have a REST service.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It gets requests like:&lt;BR /&gt;POST /users&lt;BR /&gt;and&lt;BR /&gt;GET /users&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The GET returns a bunch of users, the POST creates a new user. So while the url is the same for each, the code that gets executed is very different.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'd like to create a global web request naming rule that includes the http method in the web request name.&lt;BR /&gt;I think this should be possible.&lt;/P&gt;&lt;P&gt;In this &lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/service-api/request-naming-api/post-new-rule#definition--Placeholder" target="_self"&gt;document&lt;/A&gt;, it says that the placeholder attribute can be HTTP_REQUEST_METHOD (which I'm pretty sure is what I want).&lt;/P&gt;&lt;P&gt;But I'm having trouble crafting a payload to create a web request naming method that uses that value.&lt;/P&gt;&lt;P&gt;An example payload that I've tried is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "conditions": [{
            "attribute": "SERVICE_TAG",
            "comparisonInfo": {
                "comparison": "TAG_KEY_EQUALS",
                "negate": false,
                "type": "TAG",
                "value": {
                    "context": "CONTEXTLESS",
                    "key": "REST Cleanup With HTTP Method"
                },
                "values": null
            }
        }
    ],
    "enabled": true,
    "order": "REST 00",
    "managementZones": [],
    "namingPattern": "{HTTPMethod} {URL}",
    "placeholders": [
		{
			"aggregation": null,
            "attribute": "HTTP_REQUEST_METHOD",
            "delimiterOrRegex": null,
            "endDelimiter": null,
            "kind": "ORIGINAL_TEXT",
            "name": "HTTPMethod",
            "normalization": "ORIGINAL",
            "requestAttribute": null,
            "source": null,
            "useFromChildCalls": false
		},
		{
            "aggregation": null,
            "attribute": "WEBREQUEST_URL_PATH",
            "delimiterOrRegex": "(.*+)",
            "endDelimiter": null,
            "kind": "REGEX_EXTRACTION",
            "name": "URL",
            "normalization": "ORIGINAL",
            "requestAttribute": null,
            "source": null,
            "useFromChildCalls": false
        }
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I'm actually trying for something more complicated, which is why I have that regex for the second placeholder, but I tried distilling the example down for brevity).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That request gets me a couple of errors:&lt;/P&gt;&lt;PRE&gt;"path": "placeholders[0].attribute",&lt;BR /&gt;"message": "Placeholders are only allowed for string based attributes",&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;PRE&gt;"path": "placeholders[0].kind",&lt;BR /&gt;"message": "ExtractionKind `ORIGINAL_TEXT` is only allowed for downstream request attribute placeholders. No extraction needs to be specified",&lt;/PRE&gt;&lt;P&gt;I'm really not worried about that second one... worst case I could make it a regex extraction and that would solve that problem.&lt;/P&gt;&lt;P&gt;However, that first error is the one that I'm most worried about.&lt;BR /&gt;Specifically, it seems to be complaining about my attribute: HTTP_REQUEST_METHOD and saying that isn't a string based attribute.&lt;/P&gt;&lt;P&gt;But according to the documentation I linked above, that should be a valid attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Worse case I could create a rule so that it has a condition for HTTP_REQUEST_METHOD == GET, and then hardcode "GET" in the name... and repeat that for each of the other verbs... but that sounds tedious.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas? Thank you.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jan 2023 21:08:13 GMT</pubDate>
    <dc:creator>NeJoyerPB</dc:creator>
    <dc:date>2023-01-10T21:08:13Z</dc:date>
    <item>
      <title>Has anyone had luck using HTTP_REQUEST_METHOD in a Global Web Request Naming rule Placeholder?</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Has-anyone-had-luck-using-HTTP-REQUEST-METHOD-in-a-Global-Web/m-p/202137#M2255</link>
      <description>&lt;P&gt;I have a REST service.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It gets requests like:&lt;BR /&gt;POST /users&lt;BR /&gt;and&lt;BR /&gt;GET /users&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The GET returns a bunch of users, the POST creates a new user. So while the url is the same for each, the code that gets executed is very different.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'd like to create a global web request naming rule that includes the http method in the web request name.&lt;BR /&gt;I think this should be possible.&lt;/P&gt;&lt;P&gt;In this &lt;A href="https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/service-api/request-naming-api/post-new-rule#definition--Placeholder" target="_self"&gt;document&lt;/A&gt;, it says that the placeholder attribute can be HTTP_REQUEST_METHOD (which I'm pretty sure is what I want).&lt;/P&gt;&lt;P&gt;But I'm having trouble crafting a payload to create a web request naming method that uses that value.&lt;/P&gt;&lt;P&gt;An example payload that I've tried is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "conditions": [{
            "attribute": "SERVICE_TAG",
            "comparisonInfo": {
                "comparison": "TAG_KEY_EQUALS",
                "negate": false,
                "type": "TAG",
                "value": {
                    "context": "CONTEXTLESS",
                    "key": "REST Cleanup With HTTP Method"
                },
                "values": null
            }
        }
    ],
    "enabled": true,
    "order": "REST 00",
    "managementZones": [],
    "namingPattern": "{HTTPMethod} {URL}",
    "placeholders": [
		{
			"aggregation": null,
            "attribute": "HTTP_REQUEST_METHOD",
            "delimiterOrRegex": null,
            "endDelimiter": null,
            "kind": "ORIGINAL_TEXT",
            "name": "HTTPMethod",
            "normalization": "ORIGINAL",
            "requestAttribute": null,
            "source": null,
            "useFromChildCalls": false
		},
		{
            "aggregation": null,
            "attribute": "WEBREQUEST_URL_PATH",
            "delimiterOrRegex": "(.*+)",
            "endDelimiter": null,
            "kind": "REGEX_EXTRACTION",
            "name": "URL",
            "normalization": "ORIGINAL",
            "requestAttribute": null,
            "source": null,
            "useFromChildCalls": false
        }
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I'm actually trying for something more complicated, which is why I have that regex for the second placeholder, but I tried distilling the example down for brevity).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That request gets me a couple of errors:&lt;/P&gt;&lt;PRE&gt;"path": "placeholders[0].attribute",&lt;BR /&gt;"message": "Placeholders are only allowed for string based attributes",&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;PRE&gt;"path": "placeholders[0].kind",&lt;BR /&gt;"message": "ExtractionKind `ORIGINAL_TEXT` is only allowed for downstream request attribute placeholders. No extraction needs to be specified",&lt;/PRE&gt;&lt;P&gt;I'm really not worried about that second one... worst case I could make it a regex extraction and that would solve that problem.&lt;/P&gt;&lt;P&gt;However, that first error is the one that I'm most worried about.&lt;BR /&gt;Specifically, it seems to be complaining about my attribute: HTTP_REQUEST_METHOD and saying that isn't a string based attribute.&lt;/P&gt;&lt;P&gt;But according to the documentation I linked above, that should be a valid attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Worse case I could create a rule so that it has a condition for HTTP_REQUEST_METHOD == GET, and then hardcode "GET" in the name... and repeat that for each of the other verbs... but that sounds tedious.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas? Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 21:08:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Has-anyone-had-luck-using-HTTP-REQUEST-METHOD-in-a-Global-Web/m-p/202137#M2255</guid>
      <dc:creator>NeJoyerPB</dc:creator>
      <dc:date>2023-01-10T21:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Has anyone had luck using HTTP_REQUEST_METHOD in a Global Web Request Naming rule Placeholder?</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Has-anyone-had-luck-using-HTTP-REQUEST-METHOD-in-a-Global-Web/m-p/208147#M2383</link>
      <description>&lt;P&gt;I had same problem and solution is simple:&lt;BR /&gt;There are predefined placeholders with you can use. In this case placeholder to use:&lt;/P&gt;&lt;P&gt;{HTTP-Method} /sample/URL/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 14:13:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Has-anyone-had-luck-using-HTTP-REQUEST-METHOD-in-a-Global-Web/m-p/208147#M2383</guid>
      <dc:creator>Michał</dc:creator>
      <dc:date>2023-03-27T14:13:07Z</dc:date>
    </item>
  </channel>
</rss>

