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!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...