<?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 Windows Batch -  stdout not in the log in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-Input-Windows-Batch-stdout-not-in-the-log/m-p/85879#M17845</link>
    <description>&lt;P&gt;Found the Error. &lt;/P&gt;

&lt;P&gt;My first command did not work - i did have copied the wget.exe in the bin/scripts directory. So it was working fine as i tested it manually. But as splunk called it it seems that maybe it's called from a different location and wget.exe was not found. &lt;/P&gt;

&lt;P&gt;i copied wget.exe into my system32 folder to make sure all requests can reach it. &lt;/P&gt;

&lt;P&gt;now i get the expected output.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jul 2013 11:13:17 GMT</pubDate>
    <dc:creator>Matthias_BY</dc:creator>
    <dc:date>2013-07-05T11:13:17Z</dc:date>
    <item>
      <title>Scripted Input Windows Batch -  stdout not in the log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-Input-Windows-Batch-stdout-not-in-the-log/m-p/85876#M17842</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;i have written a batch file within windows to get some data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;wget.exe -O status.txt &lt;A href="http://192.168.178.XXX/SSI/supply_status_info.htm" target="test_blank"&gt;http://192.168.178.XXX/SSI/supply_status_info.htm&lt;/A&gt; 
"C:\Program Files (x86)\GnuWin32\bin\grep.exe" -A 1 "%1" status.txt
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If i saved the file as batch. if i run the file on the cmd mode with a parameter i get the output i want:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;C:\Program Files\Splunk\bin\scripts&amp;gt;inputs-cartridge.bat "Black Print Cartridge"
C:\Program Files\Splunk\bin\scripts&amp;gt;wget.exe -O status.txt &lt;A href="http://192.168.178.XXX/SSI/supply_status_info.htm" target="test_blank"&gt;http://192.168.178.XXX/SSI/supply_status_info.htm&lt;/A&gt;
--2013-07-05 11:19:48--  &lt;A href="http://192.168.178.100/SSI/supply_status_info.htm" target="test_blank"&gt;http://192.168.178.100/SSI/supply_status_info.htm&lt;/A&gt;
Connecting to 192.168.178.100:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `status.txt'

    [  &amp;lt;=&amp;gt;                                  ] 25,938       107K/s   in 0.2s

2013-07-05 11:19:48 (107 KB/s) - `status.txt' saved [25938] 
C:\Program Files\Splunk\bin\scripts&amp;gt;"C:\Program Files (x86)\GnuWin32\bin\grep.ex
e" -A 1 ""Black Print Cartridge"" status.txt
grep: Print: No such file or directory
grep: Cartridge: No such file or directory
status.txt:                      &amp;lt;td&amp;gt;&amp;lt;img src="/Images/Black_Toner.gif" &amp;gt; &amp;lt;/td&amp;gt;
status.txt-                    &amp;lt;/tr&amp;gt;
--
status.txt:                &amp;lt;td valign="top"&amp;gt;&amp;lt;font class="clf"&amp;gt; **Black Print Cartr
idge**&amp;lt;br&amp;gt;Order HP Part:&amp;amp;nbsp;&amp;amp;nbsp;Q6000A&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;
status.txt-                &amp;lt;td valign="top"&amp;gt;&amp;lt;font class="clf"&amp;gt;**73%**&amp;lt;br&amp;gt;&amp;lt;/font&amp;gt; &amp;lt;/t
d&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If i configure the scripted input within splunk - i only get the command line commands and not the output of the scripts... what did i wrong?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05.07.13 11:21:47,000   
C:\Windows\system32&amp;gt;wget.exe -O status.txt &lt;A href="http://192.168.178.100/SSI/supply_status_info.htm" target="test_blank"&gt;http://192.168.178.100/SSI/supply_status_info.htm&lt;/A&gt;  
C:\Windows\system32&amp;gt;"C:\Program Files (x86)\GnuWin32\bin\grep.exe" -A 1 ""Black Print Cartridge"" status.txt 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jul 2013 09:22:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-Input-Windows-Batch-stdout-not-in-the-log/m-p/85876#M17842</guid>
      <dc:creator>Matthias_BY</dc:creator>
      <dc:date>2013-07-05T09:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input Windows Batch -  stdout not in the log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-Input-Windows-Batch-stdout-not-in-the-log/m-p/85877#M17843</link>
      <description>&lt;P&gt;I would suggest you change you batch file to:&lt;/P&gt;

&lt;PRE&gt;
@ECHO OFF
wget.exe -O status.txt &lt;A href="http://192.168.178.XXX/SSI/supply_status_info.htm" target="test_blank"&gt;http://192.168.178.XXX/SSI/supply_status_info.htm&lt;/A&gt; 
"C:\Program Files (x86)\GnuWin32\bin\grep.exe" -A 1 %1 status.txt
&lt;/PRE&gt;

&lt;P&gt;I removed echo of commands to the command line and fixed you grep which isn't working as intended, because you are grepping for Black instead of your string.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2013 10:38:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-Input-Windows-Batch-stdout-not-in-the-log/m-p/85877#M17843</guid>
      <dc:creator>krugger</dc:creator>
      <dc:date>2013-07-05T10:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input Windows Batch -  stdout not in the log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-Input-Windows-Batch-stdout-not-in-the-log/m-p/85878#M17844</link>
      <description>&lt;P&gt;thanks for your response - i changed it - but now no data coming in. if i add echo "Hello World" i can see it in Splunk - so Splunk calls the script... but the batch file still does not output the proper content i want.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2013 10:59:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-Input-Windows-Batch-stdout-not-in-the-log/m-p/85878#M17844</guid>
      <dc:creator>Matthias_BY</dc:creator>
      <dc:date>2013-07-05T10:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input Windows Batch -  stdout not in the log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-Input-Windows-Batch-stdout-not-in-the-log/m-p/85879#M17845</link>
      <description>&lt;P&gt;Found the Error. &lt;/P&gt;

&lt;P&gt;My first command did not work - i did have copied the wget.exe in the bin/scripts directory. So it was working fine as i tested it manually. But as splunk called it it seems that maybe it's called from a different location and wget.exe was not found. &lt;/P&gt;

&lt;P&gt;i copied wget.exe into my system32 folder to make sure all requests can reach it. &lt;/P&gt;

&lt;P&gt;now i get the expected output.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2013 11:13:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-Input-Windows-Batch-stdout-not-in-the-log/m-p/85879#M17845</guid>
      <dc:creator>Matthias_BY</dc:creator>
      <dc:date>2013-07-05T11:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input Windows Batch -  stdout not in the log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-Input-Windows-Batch-stdout-not-in-the-log/m-p/85880#M17846</link>
      <description>&lt;P&gt;Splunk requires the batch file to be in the $SPLUNK_HOME/bin/scripts directory.&lt;/P&gt;

&lt;P&gt;Had forgotten about that.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2013 11:54:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-Input-Windows-Batch-stdout-not-in-the-log/m-p/85880#M17846</guid>
      <dc:creator>krugger</dc:creator>
      <dc:date>2013-07-05T11:54:49Z</dc:date>
    </item>
  </channel>
</rss>

