All Apps and Add-ons

Microsoft Teams Add-on for Splunk: How to set proxy (app not pulling data and logs say no proxy is set)?

aovrutsky
Explorer

It looks like the app is failing to pull data, the logs are telling me no proxy is set and I'm not sure where to set it for this app, most of the other Microsoft apps have a proxy section in the GUI - can one be added?

atuljha82
Loves-to-Learn Everything

I am facing the below issue in subscription logs-

File "D:\Program Files\Splunk\etc\apps\TA_MS_Teams\bin\ta_ms_teams\aob_py2\solnlib\modular_input\checkpointer.py", line 218, in get record = self._collection_data.query_by_id(key) File "D:\Program Files\Splunk\etc\apps\TA_MS_Teams\bin\ta_ms_teams\aob_py2\solnlib\packages\splunklib\client.py", line 3648, in query_by_id return json.loads(self._get(UrlEncoded(str(id))).body.read().decode('utf-8')) File "D:\Program Files\Splunk\etc\apps\TA_MS_Teams\bin\ta_ms_teams\aob_py2\solnlib\packages\splunklib\client.py", line 3618, in _get return self.service.get(self.path + url, owner=self.owner, app=self.app, sharing=self.sharing, **kwargs) File "D:\Program Files\Splunk\etc\apps\TA_MS_Teams\bin\ta_ms_teams\aob_py2\solnlib\packages\splunklib\binding.py", line 289, in wrapper return request_fun(self, *args, **kwargs) File "D:\Program Files\Splunk\etc\apps\TA_MS_Teams\bin\ta_ms_teams\aob_py2\solnlib\packages\splunklib\binding.py", line 71, in new_f val = f(*args, **kwargs) File "D:\Program Files\Splunk\etc\apps\TA_MS_Teams\bin\ta_ms_teams\aob_py2\solnlib\packages\splunklib\binding.py", line 679, in get response = self.http.get(path, all_headers, **query) File "D:\Program Files\Splunk\etc\apps\TA_MS_Teams\bin\ta_ms_teams\aob_py2\solnlib\packages\splunklib\binding.py", line 1183, in get return self.request(url, { 'method': "GET", 'headers': headers })

0 Karma

jconger
Splunk Employee
Splunk Employee

Version 1.0.3 of the add-on adds proxy support. https://splunkbase.splunk.com/app/4994/

0 Karma

PavelP
Motivator

Hello @aovrutsky

what kind of error message you get? If it is "INFO ProxyConfig - Failed to initialize http_proxy from server.conf for splunkd" then it is safe to ignore them.

0 Karma

aovrutsky
Explorer
2020-05-25 10:33:42,571 INFO pid=12804 tid=MainThread file=setup_util.py:log_info:117 | Proxy is not set!

This was followed by:

2020-05-25 10:29:53,763 ERROR pid=3892 tid=MainThread file=base_modinput.py:log_error:309 | Error generating access token: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /X-X-X-X/oauth2/v2.0/token (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000001F8191FE988>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

As the server is behind a proxy, the connection failed.

Most of the other Azure AD / Office 365 Splunk apps have a proxy setting in the configuration GUI somewhere, but I can't figure out how to tell this app to use a proxy.

0 Karma

PavelP
Motivator

@aovrutsky,
thank you for the clarification, now I got it.

Since this script is based on urllib3, you can modify it to add proxy support: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#proxies

aovrutsky
Explorer

Thank you for the reply, I'm not a Python expert and I see lots of places in the script where proxies can be set, I think there should be an option to set the proxy in the GUI like all the other apps rather than asking customers to dig in to application scripts manually.

0 Karma

PavelP
Motivator

Agree! `_0_/

illwerkevkwvtg
New Member

Same here, please add proxy support.

0 Karma
Did you miss .conf21 Virtual?

Good news! The event's keynotes and many of its breakout sessions are now available online, and still totally FREE!