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
*NEW* Splunk Love Promo!
Snag a $25 Visa Gift Card for Giving Your Review!

It's another Splunk Love Special! For a limited time, you can review one of our select Splunk products through Gartner Peer Insights and receive a $25 Visa gift card!

Review:





Or Learn More in Our Blog >>