<?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 Script input troubleshoot in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360606#M65768</link>
    <description>&lt;P&gt;Hi, I am trying to index from my python script. I followed the steps in this page to setup my data: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Getdatafromscriptedinputs#Add_a_scripted_input_in_Splunk_Web" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Getdatafromscriptedinputs#Add_a_scripted_input_in_Splunk_Web&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I don't know why I tried the followings without it working:&lt;BR /&gt;
- Placed the python script in these files ($SPLUNK_HOME/etc/system/bin     and     $SPLUNK_HOME/etc/apps/search/bin)&lt;BR /&gt;
- write a stanza in inputs.conf (tried both $SPLUNK_HOME/etc/system/local folder and $SPLUNK_HOME/etc/apps/search/local folder)&lt;BR /&gt;
- also wrote a stanza for props.conf in $SPLUNK_HOME/etc/system/local folder&lt;BR /&gt;
- restart the splunkd&lt;/P&gt;

&lt;P&gt;I followed steps in the documentation and also tested the scripts in command line. I still don't know what am i missing here. This is my input.conf stanza:&lt;BR /&gt;
[script://C:\Program Files\Splunk\etc\system\bin]&lt;BR /&gt;
disabled = 0&lt;BR /&gt;
host = ABC&lt;BR /&gt;
index = report&lt;BR /&gt;
interval = -1&lt;BR /&gt;
source = reportA&lt;BR /&gt;
sourcetype = report_json&lt;/P&gt;

&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 19:14:09 GMT</pubDate>
    <dc:creator>tamduong16</dc:creator>
    <dc:date>2020-09-29T19:14:09Z</dc:date>
    <item>
      <title>Script input troubleshoot</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360606#M65768</link>
      <description>&lt;P&gt;Hi, I am trying to index from my python script. I followed the steps in this page to setup my data: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Getdatafromscriptedinputs#Add_a_scripted_input_in_Splunk_Web" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Getdatafromscriptedinputs#Add_a_scripted_input_in_Splunk_Web&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I don't know why I tried the followings without it working:&lt;BR /&gt;
- Placed the python script in these files ($SPLUNK_HOME/etc/system/bin     and     $SPLUNK_HOME/etc/apps/search/bin)&lt;BR /&gt;
- write a stanza in inputs.conf (tried both $SPLUNK_HOME/etc/system/local folder and $SPLUNK_HOME/etc/apps/search/local folder)&lt;BR /&gt;
- also wrote a stanza for props.conf in $SPLUNK_HOME/etc/system/local folder&lt;BR /&gt;
- restart the splunkd&lt;/P&gt;

&lt;P&gt;I followed steps in the documentation and also tested the scripts in command line. I still don't know what am i missing here. This is my input.conf stanza:&lt;BR /&gt;
[script://C:\Program Files\Splunk\etc\system\bin]&lt;BR /&gt;
disabled = 0&lt;BR /&gt;
host = ABC&lt;BR /&gt;
index = report&lt;BR /&gt;
interval = -1&lt;BR /&gt;
source = reportA&lt;BR /&gt;
sourcetype = report_json&lt;/P&gt;

&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360606#M65768</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2020-09-29T19:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script input troubleshoot</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360607#M65769</link>
      <description>&lt;P&gt;Here is what i would do:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Place your Python file in $SPLUNK_HOME/etc/apps/search/local/bin&lt;/LI&gt;
&lt;LI&gt;Create/edit $SPLUNK_HOME/etc/apps/search/local/inputs&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Here are the contents of &lt;CODE&gt;inputs.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://.\bin\myScript.py]
interval = -1 # or some other interval
# any other settings
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Apr 2018 16:36:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360607#M65769</guid>
      <dc:creator>jconger</dc:creator>
      <dc:date>2018-04-24T16:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: Script input troubleshoot</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360608#M65770</link>
      <description>&lt;P&gt;@jconger&lt;BR /&gt;
I don't have a bin folder in that directory. Do I just create a bin folder?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 16:49:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360608#M65770</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2018-04-24T16:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script input troubleshoot</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360609#M65771</link>
      <description>&lt;P&gt;I added a bin folder in that directory but i don't have it working &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 17:03:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360609#M65771</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2018-04-24T17:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script input troubleshoot</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360610#M65772</link>
      <description>&lt;P&gt;Yes, just create a bin folder&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 17:09:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360610#M65772</guid>
      <dc:creator>jconger</dc:creator>
      <dc:date>2018-04-24T17:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Script input troubleshoot</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360611#M65773</link>
      <description>&lt;P&gt;An interval of -1 tells Splunk to run the script at start up.  Have you restarted?&lt;/P&gt;

&lt;P&gt;How are you testing this?  Are you running a search on your report index (as specified in your example inputs.conf)?&lt;/P&gt;

&lt;P&gt;Also, I'm making assumptions on your Python code.  Whatever goes to STDOUT (the screen when run from the command line) should show up in Splunk.&lt;/P&gt;

&lt;P&gt;Do you see any errors in your internal index using the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Apr 2018 17:13:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360611#M65773</guid>
      <dc:creator>jconger</dc:creator>
      <dc:date>2018-04-24T17:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Script input troubleshoot</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360612#M65774</link>
      <description>&lt;P&gt;You are right. I could see an error as below:&lt;BR /&gt;
ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\search\bin\REV_API_viewerreport.py"" python: can't open file 'C:\Program Files\Splunk\etc\apps\search\bin\REV_API_viewerreport.py': [Errno 2] No such file or directory.&lt;/P&gt;

&lt;P&gt;I do have my python script in that directory. Why does it state no such file?&lt;BR /&gt;
I used command line to run the script and I could see the changes in the index. But when I start to put the script in Splunk it doesn't work. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:14:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360612#M65774</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2020-09-29T19:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Script input troubleshoot</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360613#M65775</link>
      <description>&lt;P&gt;What does your inputs.conf look like now?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 17:51:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360613#M65775</guid>
      <dc:creator>jconger</dc:creator>
      <dc:date>2018-04-24T17:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script input troubleshoot</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360614#M65776</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/109095"&gt;@jconger&lt;/a&gt;&lt;BR /&gt;
I found out where the problem is. I have to remove the . infront of .\bin\myscript.py. But I ran into another problem with ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\system\bin\REV_API_viewerreport.py"" ImportError: No module named splunklib.client.&lt;BR /&gt;
I tried to play the splunklib packages inside bin but it still dispay the same error. How can I fix this error? &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:13:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360614#M65776</guid>
      <dc:creator>tamduong16</dc:creator>
      <dc:date>2020-09-29T19:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Script input troubleshoot</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360615#M65777</link>
      <description>&lt;P&gt;You will need to put any dependencies in your bin directory too.  splunklib.client is in the Splunk Python SDK.  You can download it here -&amp;gt; &lt;A href="http://dev.splunk.com/python"&gt;http://dev.splunk.com/python&lt;/A&gt;.  Copy the splunklib folder into your bin folder.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 19:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Script-input-troubleshoot/m-p/360615#M65777</guid>
      <dc:creator>jconger</dc:creator>
      <dc:date>2018-04-24T19:06:48Z</dc:date>
    </item>
  </channel>
</rss>

