splunk / splunk-sdk-ruby

Splunk Software Development Kit for Ruby
http://dev.splunk.com
Apache License 2.0
36 stars 21 forks source link

Option to specify path prefix for when Splunk is behind a reverse proxy #30

Closed haku closed 10 years ago

haku commented 10 years ago

It would be useful to support providing a path prefix for when Splunk is hosted behind a load balancer or reverse proxy. e.g. Splunk may be running behind an Apache HTTPd proxy with config something like:

ProxyPass /test_splunk_api http://localhost:8089

In this scenario we could then use something like:

Splunk::Service.new(
  :host => 'example.com',
  :path => '/test_splunk_api'
)

If you do not have time ATM I am happy to make this change and raise it as a pull request.

haku commented 10 years ago

I found some time to fix this myself. I have also added options for specifying SSL client certificates and an HTTP proxy (alas our network layout is more exciting that most). I added an updated copy of connect example to show how these options can be used. Hopefully this will ease the pain for others dealing with similarly exciting networks.

glennblock commented 10 years ago

@itay @madhadron thoughts?

glennblock commented 10 years ago

@haku thanks for sending this!

itay commented 10 years ago

Overall it looks pretty good. We'd need to a couple of tests as well for these cases, but this is good.

glennblock commented 10 years ago

@haku Please fill out our CLA (http://www.splunk.com/goto/individualcontributions) as we'll need this in order to move forward.

Thanks!

haku commented 10 years ago

@glennblock I filled in that form for you.

haku commented 10 years ago

Can this please be merged now? Or are you still waiting for something from me?

glennblock commented 10 years ago

Hi @haku thanks for your patience, I think this fell off our radar. I am looking into it now.

glennblock commented 10 years ago

@madhadron can you take a look?

madhadron commented 10 years ago

Yes, it just dropped off our radar. LGTM. We'll need to get tests written for the new code before we merge it to master, so I'm going to merge it to develop for now. It will go out with the next release.