Splunk Search

Sending Logs to splunk from logstash

ragmenion
New Member

Hi i am trying to send logs to splunk with HEC using logstash, but configuration is not working. A curl from the server is working but logs arent going through logstaash.

curl -k "https://splunk-hec.test.com:443/services/collector/raw?" \
-H "Authorization: Splunk XXXX" \
-d '{"event": "Hello!", "sourceType": "Test"}'

Logstash output config

http {
http_method => "post"
url => "https://splunk-hec.test.com:443/services/collector/event/1.0"
headers => ['Authorization', 'Splunk XXXXX']
mapping => {
"sourcetype" => "logstash"
}
}

Error

[HTTP Output Failure] Could not fetch URL {:url=>"https//splunk-hec.test.com:443/services/collector/event/1.0", :method=>:post, :body=>"{\"sourcetype\":\"logstash\"}", :headers=>{"Authorization"=>"Splunk XXX", :message=>"connect timed out",

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Timeouts most commonly are caused by lack of network connectivity, e.g. a firewall dropping your connection.
Assuming you did the curl test on a different machine, run the curl test on the machine that runs fails with logstash, and if curl fails there too then talk to your network team.

0 Karma
Get Updates on the Splunk Community!

Developer Spotlight with Brett Adams

In our third Spotlight feature, we're excited to shine a light on Brett—a Splunk consultant, innovative ...

Index This | What can you do to make 55,555 equal 500?

April 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...