<?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 Splunk .bat script file not getting triggered in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-bat-script-file-not-getting-triggered/m-p/296479#M56207</link>
    <description>&lt;P&gt;I'm having a simple alert (for POC, so checking with _internal data) and on alert action there is 'add to triggered alerts' and 'run a script'. I'm able to see the triggered alerts, but the .bat file doesn't seem to run. I'm able to run it manually, but not through the alert action.&lt;/P&gt;

&lt;P&gt;I've placed my try.bat under $splunk_home$/bin/scripts folder. While checking for "try.bat" in index=_internal, i get the below event:&lt;/P&gt;

&lt;P&gt;2018-01-05 18:22:19,585 +0530 INFO  &lt;STRONG&gt;runshellscript:141&lt;/STRONG&gt; - &lt;STRONG&gt;['C:\Program Files\Splunk\bin\scripts\try.bat',&lt;/STRONG&gt; '44', 'index^=&lt;EM&gt;internal^ 3mreportErrors', 'index^=_internal^ 3mreportErrors', 'testAlert', 'Saved^ Search^ ^[testAlert^]^ number^ of^ events^(44^)', '&lt;A href="http://CDC2-L-5286WND:8001/app/3m/@go?sid%5E=scheduler" target="_blank"&gt;http://CDC2-L-5286WND:8001/app/3m/@go?sid^=scheduler&lt;/A&gt;&lt;/EM&gt;&lt;EM&gt;admin&lt;/EM&gt;&lt;EM&gt;3m&lt;/EM&gt;&lt;EM&gt;testAlert_at_1515156720_51', '', 'C:\Program Files\Splunk\var\run\splunk\dispatch\scheduler&lt;/EM&gt;&lt;EM&gt;admin&lt;/EM&gt;&lt;EM&gt;3m&lt;/EM&gt;_testAlert_at_1515156720_51\results.csv.gz']&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;try.bat&lt;/STRONG&gt;&lt;BR /&gt;
@echo off&lt;BR /&gt;
REM Next command inputs the greeting&lt;BR /&gt;
echo Hello! This a sample batch file.&lt;BR /&gt;
time /t &amp;gt;&amp;gt; "c:\sandya\output.txt"&lt;/P&gt;

&lt;P&gt;I'm using Windows 10, Splunk 7&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 17:34:04 GMT</pubDate>
    <dc:creator>sandyasampath</dc:creator>
    <dc:date>2020-09-29T17:34:04Z</dc:date>
    <item>
      <title>Splunk .bat script file not getting triggered</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-bat-script-file-not-getting-triggered/m-p/296479#M56207</link>
      <description>&lt;P&gt;I'm having a simple alert (for POC, so checking with _internal data) and on alert action there is 'add to triggered alerts' and 'run a script'. I'm able to see the triggered alerts, but the .bat file doesn't seem to run. I'm able to run it manually, but not through the alert action.&lt;/P&gt;

&lt;P&gt;I've placed my try.bat under $splunk_home$/bin/scripts folder. While checking for "try.bat" in index=_internal, i get the below event:&lt;/P&gt;

&lt;P&gt;2018-01-05 18:22:19,585 +0530 INFO  &lt;STRONG&gt;runshellscript:141&lt;/STRONG&gt; - &lt;STRONG&gt;['C:\Program Files\Splunk\bin\scripts\try.bat',&lt;/STRONG&gt; '44', 'index^=&lt;EM&gt;internal^ 3mreportErrors', 'index^=_internal^ 3mreportErrors', 'testAlert', 'Saved^ Search^ ^[testAlert^]^ number^ of^ events^(44^)', '&lt;A href="http://CDC2-L-5286WND:8001/app/3m/@go?sid%5E=scheduler" target="_blank"&gt;http://CDC2-L-5286WND:8001/app/3m/@go?sid^=scheduler&lt;/A&gt;&lt;/EM&gt;&lt;EM&gt;admin&lt;/EM&gt;&lt;EM&gt;3m&lt;/EM&gt;&lt;EM&gt;testAlert_at_1515156720_51', '', 'C:\Program Files\Splunk\var\run\splunk\dispatch\scheduler&lt;/EM&gt;&lt;EM&gt;admin&lt;/EM&gt;&lt;EM&gt;3m&lt;/EM&gt;_testAlert_at_1515156720_51\results.csv.gz']&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;try.bat&lt;/STRONG&gt;&lt;BR /&gt;
@echo off&lt;BR /&gt;
REM Next command inputs the greeting&lt;BR /&gt;
echo Hello! This a sample batch file.&lt;BR /&gt;
time /t &amp;gt;&amp;gt; "c:\sandya\output.txt"&lt;/P&gt;

&lt;P&gt;I'm using Windows 10, Splunk 7&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:34:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-bat-script-file-not-getting-triggered/m-p/296479#M56207</guid>
      <dc:creator>sandyasampath</dc:creator>
      <dc:date>2020-09-29T17:34:04Z</dc:date>
    </item>
  </channel>
</rss>

