<?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: python3.7, splunk 8.0, OS-RHEL8, when running scripted input getting error import BS4 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/python3-7-splunk-8-0-OS-RHEL8-when-running-scripted-input/m-p/491542#M194249</link>
    <description>&lt;P&gt;Hi mohammadsharukh,&lt;/P&gt;

&lt;P&gt;most likely you installed the module in your system library which is not used by Splunk. If I want to use a special python module I put it in &lt;CODE&gt;$SPLUNK_HOME/etc/apps/YourAppNameHere/bin&lt;/CODE&gt; and load it from my script in the same directory.&lt;/P&gt;

&lt;P&gt;You can manually check if this works by running these commands:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/opt/splunk/bin/splunk cmd /bin/bash
cd $SPLUNK_HOME/etc/apps/YourAppNameHere/bin
$SPLUNK_HOME/bin/splunk cmd python
import moduleNameHere
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if this works without error messages you're all good to go, otherwise check what the error states (like missing dependencies and things)&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Sun, 26 Jan 2020 20:35:02 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2020-01-26T20:35:02Z</dc:date>
    <item>
      <title>python3.7, splunk 8.0, OS-RHEL8, when running scripted input getting error import BS4</title>
      <link>https://community.splunk.com/t5/Splunk-Search/python3-7-splunk-8-0-OS-RHEL8-when-running-scripted-input/m-p/491541#M194248</link>
      <description>&lt;P&gt;Change the python varaible to phython3 and ran the following commnad&lt;/P&gt;

&lt;P&gt;dnf install python3-pip&lt;BR /&gt;
     dnf install python3-beautifulsoup4&lt;BR /&gt;
     pip3 install --user BeautifulSoup4&lt;/P&gt;

&lt;P&gt;tried for a scripted input but getting the following error&lt;/P&gt;

&lt;P&gt;01-26-2020 18:00:29.522 +0000 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/search/bin/cric.py"     import bs4&lt;BR /&gt;
01-26-2020 18:00:29.522 +0000 ERROR ExecProcessor - message from "/opt/splunk/bin/python3.7 /opt/splunk/etc/apps/search/bin/cric.py" ModuleNotFoundError: No module named 'bs4'&lt;/P&gt;

&lt;P&gt;How to import BS4&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2020 18:18:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/python3-7-splunk-8-0-OS-RHEL8-when-running-scripted-input/m-p/491541#M194248</guid>
      <dc:creator>mohammadsharukh</dc:creator>
      <dc:date>2020-01-26T18:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: python3.7, splunk 8.0, OS-RHEL8, when running scripted input getting error import BS4</title>
      <link>https://community.splunk.com/t5/Splunk-Search/python3-7-splunk-8-0-OS-RHEL8-when-running-scripted-input/m-p/491542#M194249</link>
      <description>&lt;P&gt;Hi mohammadsharukh,&lt;/P&gt;

&lt;P&gt;most likely you installed the module in your system library which is not used by Splunk. If I want to use a special python module I put it in &lt;CODE&gt;$SPLUNK_HOME/etc/apps/YourAppNameHere/bin&lt;/CODE&gt; and load it from my script in the same directory.&lt;/P&gt;

&lt;P&gt;You can manually check if this works by running these commands:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/opt/splunk/bin/splunk cmd /bin/bash
cd $SPLUNK_HOME/etc/apps/YourAppNameHere/bin
$SPLUNK_HOME/bin/splunk cmd python
import moduleNameHere
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if this works without error messages you're all good to go, otherwise check what the error states (like missing dependencies and things)&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2020 20:35:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/python3-7-splunk-8-0-OS-RHEL8-when-running-scripted-input/m-p/491542#M194249</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2020-01-26T20:35:02Z</dc:date>
    </item>
  </channel>
</rss>

