Encoded Space char as %20 on Collect URI
Hi, I have an API endpoint which require parameter to use a time string in the format of %Y-%m-%d %H:%M, which e.g. look something like this:
https://host/api/v1.0/endpoint?start=2024-06-21 14:00&end=2024-06-21 15:00
However when I put this on the URL, it always get converted to a value of 2024-06-21%2014:00 using example above. The API endpoint is unable to accept %20 and always ended up throwing error.
Is there a way to avoid space being converted in Discover/Collect URI in REST API collector?
Comments
-
The time string were calculating using a combination of javascript functions. E.g. C.Time.strftime(Date.now()/1000, "%Y-%m-%d %H: %M)
I have also tried escaping the space e.g. C.Time.strftime(Date.now()/1000, "%Y-%m-%d\ %H\: %M). It seems to have worked for the time colon char ':' but space consistently get converted to %20.
0 -
Hi @JH Liew
Strange that it expects actual blanks.
You could try disabling the "Decode URL" option in the Collector settings. ("Collector Settings" → "Optional Settings")
"Decode URL: When toggled toNo
, Cribl Stream will not decode URLs before sending the HTTP request. This setting applies to collect, authentication, and pagination requests. Defaults toYes
."1 -
Didn't realise there's this option. I was running older version of Cribl (due to dev environment, which we haven't update for awhile), thanks!
0