All Apps and Add-ons

Is there a way for the HipChat Room Notification Alert app to use an http_proxy setting to make calls to the internet?

mjlehman99
New Member

Is there a way for certain Splunk apps to use a http_proxy setting to be able to make calls to the internet?

The one app I am targeting is the "HipChat Room Notification Alert" app. I need to be able to go through the http_proxy to get from the DC to the HC Room I am targeting.

I have seen the splunk-launch.conf file to set it for Splunk Web to use. Just not sure if this gets passed to splunk apps.

Thanks,

0 Karma

jeremiahMN
Explorer

You'll want to install an opener like so...

existing code:

req = urllib2.Request(url, body, {"Content-Type": "application/json"})
    try:
        res = urllib2.urlopen(req)


Change to: (modify to suite your proxy address/port. Also if you need http and https calls you'll need to add both. )

req = urllib2.Request(url, body, {"Content-Type": "application/json"})
    proxy = urllib2.ProxyHandler({'https': '127.0.0.1:8080'})
    opener = urllib2.build_opener(proxy)
    urllib2.install_opener(opener)
    try:
        res = urllib2.urlopen(req)

passbt
Explorer

Thanks, adding this to the hipchat.py worked!

0 Karma

flle
Path Finder

Hi,

as there is no answer yet and I had the same question:
Yes, proxy settings in /etc/splunk-launch.conf are passed to Splunk apps.
Just adding

http_proxy=<proxyname>:<port>

or for https:

https_proxy=<proxyname>:<port>

to splunk-launch.conf worked for me and the Hipchat app happily uses the proxy for notification forwarding.

0 Karma

passbt
Explorer

I downvoted this post because i tried this, restarted splunk, and it is not working for me. after reviewing hipchat.py, i'm not sure the how this would work anyway.

0 Karma
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...