<?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: Why my inputs.conf doesn't run? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190460#M37913</link>
    <description>&lt;P&gt;Hi sjlin,&lt;/P&gt;

&lt;P&gt;use this as start script for your input: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$SPLUNK_HOME\bin\splunk cmd python execute.py arg1 arg2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this way all Splunk relevant environment settings are made and the script will be executed as Splunk user.&lt;BR /&gt;
Or you call/start your &lt;CODE&gt;execute.py&lt;/CODE&gt; directly and use &lt;CODE&gt;$SPLUNK_HOME\bin\python&lt;/CODE&gt; as shebang ...&lt;BR /&gt;
like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$SPLUNK_HOME\bin\python execute.py arg1 arg2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Mon, 17 Mar 2014 10:28:14 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-03-17T10:28:14Z</dc:date>
    <item>
      <title>Why my inputs.conf doesn't run?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190459#M37912</link>
      <description>&lt;P&gt;I have a starter_script.bat in &lt;CODE&gt;$splunk_home\etc\apps\MyApp\bin&lt;/CODE&gt;, and its content are:&lt;BR /&gt;
    @echo off&lt;BR /&gt;
    python &lt;CODE&gt;"C:\Program Files\Splunk\etc\apps\MyApp\bin\execute.py"&lt;/CODE&gt; arg1 arg2&lt;/P&gt;

&lt;P&gt;and the &lt;CODE&gt;$splunk_home\etc\apps\MyApp\default\inputs.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://.\bin\starter_script.bat]
disabled = false
interval = 10
index = default
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;after restart inputs.conf, I use the command "splunk.exe cmd btool inputs list" to see if the bat is running, and I can see that:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://C:\Program Files\Splunk\etc\apps\MyApp\bin\starter_script.bat]
_rcvbuf = 1572864
disabled = false
evt_dc_name =
evt_dns_name =
evt_resolve_ad_obj = 0
host = WIN-MyHost
index = default
interval = 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The .bat is not working, but I am sure it can be working when I try it manually.&lt;BR /&gt;
I am wondering if any configuration I set is wrong? &lt;BR /&gt;
Any response is appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:09:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190459#M37912</guid>
      <dc:creator>sjlin</dc:creator>
      <dc:date>2020-09-28T16:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why my inputs.conf doesn't run?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190460#M37913</link>
      <description>&lt;P&gt;Hi sjlin,&lt;/P&gt;

&lt;P&gt;use this as start script for your input: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$SPLUNK_HOME\bin\splunk cmd python execute.py arg1 arg2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this way all Splunk relevant environment settings are made and the script will be executed as Splunk user.&lt;BR /&gt;
Or you call/start your &lt;CODE&gt;execute.py&lt;/CODE&gt; directly and use &lt;CODE&gt;$SPLUNK_HOME\bin\python&lt;/CODE&gt; as shebang ...&lt;BR /&gt;
like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$SPLUNK_HOME\bin\python execute.py arg1 arg2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2014 10:28:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190460#M37913</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-17T10:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why my inputs.conf doesn't run?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190461#M37914</link>
      <description>&lt;P&gt;Thanks for your reply. &lt;BR /&gt;
I modify the bat as:&lt;BR /&gt;
@echo off&lt;BR /&gt;
"C:\Program Files\Splunk\bin\python" "C:\Program Files\Splunk\etc\apps\MyApp\bin\execute.py" arg1 arg2&lt;/P&gt;

&lt;P&gt;and&lt;BR /&gt;
@echo off&lt;BR /&gt;
"C:\Program Files\Splunk\bin\splunk" cmd python "C:\Program Files\Splunk\etc\apps\MyApp\bin\execute.py" arg1 arg2&lt;/P&gt;

&lt;P&gt;It seems like the neither of the two ways is working...&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2014 11:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190461#M37914</guid>
      <dc:creator>sjlin</dc:creator>
      <dc:date>2014-03-17T11:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why my inputs.conf doesn't run?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190462#M37915</link>
      <description>&lt;P&gt;why are you using a .bat to start a python script? start the python script directly instead&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2014 11:22:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190462#M37915</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-17T11:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why my inputs.conf doesn't run?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190463#M37916</link>
      <description>&lt;P&gt;Do you mean modify inputs.conf as below?&lt;BR /&gt;
[script://$SPLUNK_HOME\bin\python $SPLUNK_HOME\etc\apps\MyApp\bin\execute.py arg1 arg2]&lt;BR /&gt;
disabled = false&lt;BR /&gt;
interval = 10&lt;BR /&gt;
index = default&lt;/P&gt;

&lt;P&gt;And I find some error message in splunkd.log in either way:&lt;BR /&gt;
03-17-2014 19:40:01.181 +0800 ERROR ExecProcessor - Ignoring: ""C:\Program Files\Splunk\bin\python" "C:\Program Files\Splunk\etc\apps\MyApp\bin\execute.py" arg1 arg2"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:09:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190463#M37916</guid>
      <dc:creator>sjlin</dc:creator>
      <dc:date>2020-09-28T16:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why my inputs.conf doesn't run?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190464#M37917</link>
      <description>&lt;P&gt;no, you can call your execute.py as input script. place &lt;CODE&gt;#!$SPLUNK_HOME\bin\python&lt;/CODE&gt; at the first line of execute.py&lt;/P&gt;

&lt;P&gt;if it still fails, read this &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptWriting"&gt;http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptWriting&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2014 11:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190464#M37917</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-17T11:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why my inputs.conf doesn't run?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190465#M37918</link>
      <description>&lt;P&gt;I change inputs.conf as:&lt;BR /&gt;
[script://.\bin\execute.py arg1 arg2]&lt;BR /&gt;
disabled = false&lt;BR /&gt;
interval = 10&lt;BR /&gt;
index = default&lt;/P&gt;

&lt;P&gt;and add #!$SPLUNK_HOME\bin\python to the first line of execute.py&lt;/P&gt;

&lt;P&gt;It is still not working...&lt;BR /&gt;
I have read  &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptWriting"&gt;http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptWriting&lt;/A&gt;, but I can't get something useful...&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2014 02:44:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190465#M37918</guid>
      <dc:creator>sjlin</dc:creator>
      <dc:date>2014-03-18T02:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why my inputs.conf doesn't run?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190466#M37919</link>
      <description>&lt;P&gt;since your on windows your path must look like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[script://.\bin\execute.py arg1 arg2]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2014 06:55:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-my-inputs-conf-doesn-t-run/m-p/190466#M37919</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-18T06:55:28Z</dc:date>
    </item>
  </channel>
</rss>

