04 Apr 2025 11:42 PM
Hello! Using DQL, I'd like to use the "parse" command to break a string like "/api/abc/abc/abc/123" into "endpoint=/api/abc/abc/abc/", and "target=123". Ideally, I can apply this to any incoming API call. The strings may represent different API calls, so the output I'm looking for is something like the following:
I'm trying to make the "{*}" a literal replacement for the data that I take out.
The end goal is to eventually aggregate the occurrences of a specific endpoint even without the target, or interactions with a target even without the endpoint.
Would you have any idea how to do this? I'd really appreciate the help! Thanks in advance!
Solved! Go to Solution.
05 Apr 2025 05:47 PM
Hello!
Using DQL, it is feasible to achieve this. I will execute two pipe:
data record(span = "/api/abc/abc/abc/123")
| fieldsAdd parse(span," '/api/abc/abc/abc/' LD:target")
| fieldsAdd endpoint = replaceString(span, target, "{*}" )
| fields target, endpoint