<?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: Scripted input question  for batch file in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-question-for-batch-file/m-p/55551#M10849</link>
    <description>&lt;P&gt;Your &lt;CODE&gt;source=&lt;/CODE&gt; might be causing an issue.  By default, Splunk will set up the source value to &lt;CODE&gt;$SPLUNK_HOME\etc\system\bin\MemoryPerf.bat&lt;/CODE&gt;, I would comment out this line and see if it starts working.&lt;/P&gt;

&lt;P&gt;Also, take a look at &lt;CODE&gt;$SPLUNK_HOME\var\log\splunk\splunkd.log&lt;/CODE&gt;, and it should tell you if the script is actually executing or not.  You can also run &lt;CODE&gt;$SPLUNK_HOME\bin\splunk cmd btool inputs list&lt;/CODE&gt; to see if you can find your script listed, as this will indicate if the configuration is correct.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Sep 2012 16:20:12 GMT</pubDate>
    <dc:creator>adamw</dc:creator>
    <dc:date>2012-09-10T16:20:12Z</dc:date>
    <item>
      <title>Scripted input question  for batch file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-question-for-batch-file/m-p/55550#M10848</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I cannot get the value of scripted input by using batch file as wrapper script. My configuration is as below:&lt;BR /&gt;
MemoryPerf.bat and counters.exe in etc\system\bin&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;@ECHO OFF 

counters.exe 6 Memory "Page Faults/sec" "%% Committed Bytes In Use" "Committed Bytes" "Pages/sec" "Available MBytes"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Inputs.conf in etc\system\local&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://$SPLUNK_HOME\etc\system\bin\MemoryPerf.bat]
interval = 6
index = default
source = cript://MemoryPerf.bat
disabled = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But after that, it didn't work. i opened task manager and did't see the counters instance in the list too. Do you know what wrong i did ?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2012 14:23:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-question-for-batch-file/m-p/55550#M10848</guid>
      <dc:creator>sieutruc</dc:creator>
      <dc:date>2012-09-10T14:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input question  for batch file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-question-for-batch-file/m-p/55551#M10849</link>
      <description>&lt;P&gt;Your &lt;CODE&gt;source=&lt;/CODE&gt; might be causing an issue.  By default, Splunk will set up the source value to &lt;CODE&gt;$SPLUNK_HOME\etc\system\bin\MemoryPerf.bat&lt;/CODE&gt;, I would comment out this line and see if it starts working.&lt;/P&gt;

&lt;P&gt;Also, take a look at &lt;CODE&gt;$SPLUNK_HOME\var\log\splunk\splunkd.log&lt;/CODE&gt;, and it should tell you if the script is actually executing or not.  You can also run &lt;CODE&gt;$SPLUNK_HOME\bin\splunk cmd btool inputs list&lt;/CODE&gt; to see if you can find your script listed, as this will indicate if the configuration is correct.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2012 16:20:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-question-for-batch-file/m-p/55551#M10849</guid>
      <dc:creator>adamw</dc:creator>
      <dc:date>2012-09-10T16:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input question  for batch file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-question-for-batch-file/m-p/55552#M10850</link>
      <description>&lt;P&gt;I have already found the solution. Intuitively, i guess that Splunk, when it runs, it will set the current directory for batch file as C:\Windows\system32 to get cmd.exe. So in order to change back to the current place where the batch file is being stored, we use a small trick and put it at the beginning of the batch script as&lt;/P&gt;

&lt;P&gt;@ECHO OFF&lt;/P&gt;

&lt;P&gt;cd /d %~dp0&lt;/P&gt;

&lt;P&gt;[your script at the same folder as batch file]&lt;/P&gt;

&lt;P&gt;Thanks for your suggestion about splunkd.log.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2012 07:58:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-question-for-batch-file/m-p/55552#M10850</guid>
      <dc:creator>sieutruc</dc:creator>
      <dc:date>2012-09-11T07:58:00Z</dc:date>
    </item>
  </channel>
</rss>

