Splunk Cloud Platform

Getting error Failed to connect to instancename.cloud.splunk.com port 8088: Timed out

swadeepmohanty
New Member

Every time I am getting error when I am trying to run following command:
curl -k https://instancename.cloud.splunk.com:8088/services/collector/event -H "Authorization: Splunk TOKEN" -d '{"event": "hello world"}'
This is my Self-service Splunk Cloud.
Even I tried with Postman with POST method and setting Authorization Key with token as Header, still getting There was an error connecting to https://instancename.cloud.splunk.com//services/collector/event.

Labels (1)
Tags (1)
0 Karma
1 Solution

PavelP
Motivator

Hello @swadeepmohanty ,
what is the exact error you are getting? Try this command:

time curl -k -vvvvv https://instancename.cloud.splunk.com:8088/services/collector/event -H "Authorization: Splunk TOKEN" -d '{"event": "hello world"}'

The prepended time command will show how long does the curl request take. The -vvvvv switch will show verbose info.

Let me know how it went.

View solution in original post

0 Karma

PavelP
Motivator

Hello @swadeepmohanty ,
what is the exact error you are getting? Try this command:

time curl -k -vvvvv https://instancename.cloud.splunk.com:8088/services/collector/event -H "Authorization: Splunk TOKEN" -d '{"event": "hello world"}'

The prepended time command will show how long does the curl request take. The -vvvvv switch will show verbose info.

Let me know how it went.

0 Karma

swadeepmohanty
New Member

By running the command with -vvvvv I am getting the following error:
* upload completely sent off: 8 out of 8 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Bad Request
< Date: Sat, 18 Apr 2020 15:31:51 GMT
< Content-Type: application/json; charset=UTF-8
< X-Content-Type-Options: nosniff
< Content-Length: 64
< Vary: Authorization
< Connection: Keep-Alive
< X-Frame-Options: SAMEORIGIN
< Server: Splunkd
<
{"text":"Invalid data format","code":6,"invalid-event-number":0}* Connection #0 to host input-prd-p-5x72v3pzvdnj.cloud.splunk.com left intact
curl: (3) unmatched close brace/bracket in URL position 12:
hello world}'

0 Karma

PavelP
Motivator

ohh, you're on windows! 🙂
use double quote and escape them in json:

curl -k -vvvvv https://instancename.cloud.splunk.com:8088/services/collector/event -H "Authorization: Splunk TOKEN" -d "{\"event\": \"hello world\"}"
0 Karma

swadeepmohanty
New Member

Awesome! It worked. 🙂

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...