Open vertex opened 3 years ago
try https://hostname:443/some/path -> hostname:443/some/path
I have a similar problem. In my organization splunk url looks like this <hostname>/observability/splunk
. I get the error:
Error: parse "https://<hostname>%2Fobservability%2Fsplunk/servicesNS/<irrelevant_url_part>": invalid URL escape "%2F"
I looked into the code and this is what I found:
url
is not parsed as URL but used as host
. Looks like when Provider is built, url
is passed to client.NewSplunkdClient
to build a new Client. So url
is assigned to Client.host
https://github.com/splunk/terraform-provider-splunk/blob/0cb4f0706dfc0dea10c5ec89fae192e98341a5db/splunk/provider.go#L125
When url.URL
is built, the BuildSplunkURL
method uses Client.host
as Host
. The method doesn't parse host and doesn't interpret the part after /
as Path
.
https://github.com/splunk/terraform-provider-splunk/blob/0cb4f0706dfc0dea10c5ec89fae192e98341a5db/client/client.go#L91
I am still getting error.
splunk_saved_searches.new-search-01: Creating... ╷ │ Error: parse "https://myURL%2Fen-US%2Fapp%2Fsearch/servicesNS/user01/search/saved/searches?count=-1&output_mode=json": invalid URL escape "%2F" │ │ with splunk_saved_searches.new-search-01, │ on main.tf line 15, in resource "splunk_saved_searches" "new-search-01": │ 15: resource "splunk_saved_searches" "new-search-01" {
Configuring a URL with a PATH provides an error, for example:
Provides the error: