<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python script - module urllib.request error in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Python-script-module-urllib-request-error/m-p/506768#M9223</link>
    <description>&lt;P&gt;When you run the script in the OS, are you using the Splunk environment?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;splunk cmd python ...&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 30 Jun 2020 18:24:22 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-06-30T18:24:22Z</dc:date>
    <item>
      <title>Python script - module urllib.request error</title>
      <link>https://community.splunk.com/t5/Alerting/Python-script-module-urllib-request-error/m-p/506764#M9222</link>
      <description>&lt;P&gt;I'm experiencing issue running python script as trigger action.&lt;/P&gt;&lt;P&gt;I got error from &lt;STRONG&gt;urllib.request&lt;/STRONG&gt; module:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;x = urllib.request.urlopen('&lt;A href="https://www.google.com/" target="_blank" rel="noopener"&gt;https://www.google.com/&lt;/A&gt;')&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;File "/opt/splunk/lib/python3.7/urllib/request.py", line 222, in urlopen&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;return opener.open(url, data, timeout)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;File "/opt/splunk/lib/python3.7/urllib/request.py", line 525, in open&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;response = self._open(req, data)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;File "/opt/splunk/lib/python3.7/urllib/request.py", line 548, in _open&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'unknown_open', req)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;File "/opt/splunk/lib/python3.7/urllib/request.py", line 503, in _call_chain&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;result = func(*args)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;File "/opt/splunk/lib/python3.7/urllib/request.py", line 1387, in unknown_open&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;raise URLError('unknown url type: %s' % type)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;urllib.error.URLError: &amp;lt;urlopen error unknown url type: https&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I run script from Python in OS it works.&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 18:07:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Python-script-module-urllib-request-error/m-p/506764#M9222</guid>
      <dc:creator>antonioformato</dc:creator>
      <dc:date>2020-06-30T18:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Python script - module urllib.request error</title>
      <link>https://community.splunk.com/t5/Alerting/Python-script-module-urllib-request-error/m-p/506768#M9223</link>
      <description>&lt;P&gt;When you run the script in the OS, are you using the Splunk environment?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;splunk cmd python ...&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 30 Jun 2020 18:24:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Python-script-module-urllib-request-error/m-p/506768#M9223</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-06-30T18:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python script - module urllib.request error</title>
      <link>https://community.splunk.com/t5/Alerting/Python-script-module-urllib-request-error/m-p/506781#M9224</link>
      <description>&lt;P&gt;No,&lt;/P&gt;&lt;P&gt;I'm using&lt;/P&gt;&lt;P&gt;#python3 myscript.py&lt;/P&gt;&lt;P&gt;running&lt;/P&gt;&lt;P&gt;#/opt/splunk/bin/python3.7 myscript.py&lt;/P&gt;&lt;P&gt;doesn't work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 20:32:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Python-script-module-urllib-request-error/m-p/506781#M9224</guid>
      <dc:creator>antonioformato</dc:creator>
      <dc:date>2020-06-30T20:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Python script - module urllib.request error</title>
      <link>https://community.splunk.com/t5/Alerting/Python-script-module-urllib-request-error/m-p/506787#M9225</link>
      <description>Running the script using the instance of Python supplied by the OS is not a good test because it may not match the version supplied by Splunk and will not have the same libraries.</description>
      <pubDate>Tue, 30 Jun 2020 20:55:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Python-script-module-urllib-request-error/m-p/506787#M9225</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-06-30T20:55:30Z</dc:date>
    </item>
  </channel>
</rss>

