Splunk Dev

502 Bad Gateway with Create Oneshot in Ruby SDK

Loscil
Explorer

Hello,
I'm able to connect to my splunk server and do some things with fetching the names of saved searches (but not running them), executing rt commands (with incorrect responses), but the most concerning of all is that I get a 502 bad gateway when attempting to create a one-shot.
The error is:

~/.rvm/gems/ruby-1.9.3-p429/gems/splunk-sdk-ruby-1.0.2/lib/splunk-sdk-ruby/context.rb:408:in `request_by_url': HTTP 502 BAD_GATEWAY: (Splunk::SplunkHTTPError)

Would anyone have any ideas as to what is causing this problem? It appears that I cannot correctly run any queries.

0 Karma

psanford_splunk
Splunk Employee
Splunk Employee

For dispatching a saved search - see this answer: http://splunk-base.splunk.com/answers/97957/set-default-app-in-ruby-api

and general docs on dev.splunk.com: http://dev.splunk.com/view/SP-CAAAEP7

For the oneshot issue - post the code and we can go from there.

0 Karma

Neeraj_Luthra
Splunk Employee
Splunk Employee

The 502 gateway error almost seems like something to do with your network setup, although it doesn't explain the "incorrect responses" for realtime command.

Are you able to post the code you are using for the 2 issues you are running into?

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...