<?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 Universal Forwarder: Why does the following error appear when I launch a batch file? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-Why-does-the-following-error-appear-when-I/m-p/420874#M74049</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;
I have faced this error when launching a batch file with Splunk:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ERROR ExecProcessor - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\SQLFailed_logon\bin\script\LogCheck.bat"" **set was unexpected at this time.**
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I try to run this file by myself it works great. But when the batch starts Splunk Universal Forwarder, it has an error: "set was unexpected at this time" &lt;/P&gt;

&lt;P&gt;It's strange that this script works on the similar servers with no errors but other servers with errors.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Aug 2018 06:56:47 GMT</pubDate>
    <dc:creator>atyshke1</dc:creator>
    <dc:date>2018-08-24T06:56:47Z</dc:date>
    <item>
      <title>Universal Forwarder: Why does the following error appear when I launch a batch file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-Why-does-the-following-error-appear-when-I/m-p/420874#M74049</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I have faced this error when launching a batch file with Splunk:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ERROR ExecProcessor - message from ""C:\Program Files\SplunkUniversalForwarder\etc\apps\SQLFailed_logon\bin\script\LogCheck.bat"" **set was unexpected at this time.**
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I try to run this file by myself it works great. But when the batch starts Splunk Universal Forwarder, it has an error: "set was unexpected at this time" &lt;/P&gt;

&lt;P&gt;It's strange that this script works on the similar servers with no errors but other servers with errors.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 06:56:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-Why-does-the-following-error-appear-when-I/m-p/420874#M74049</guid>
      <dc:creator>atyshke1</dc:creator>
      <dc:date>2018-08-24T06:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Universal Forwarder: Why does the following error appear when I launch a batch file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-Why-does-the-following-error-appear-when-I/m-p/420875#M74050</link>
      <description>&lt;P&gt;The script contains a code;&lt;BR /&gt;
setlocal enabledelayedexpansion&lt;BR /&gt;
set d=%date:~0,2%&lt;BR /&gt;
set m=%date:~3,2%&lt;BR /&gt;
set y=%date:~6,4%&lt;BR /&gt;
if %d:~0,1%==0 set d=%d:~1%&lt;BR /&gt;
if %m:~0,1%==0 set m=%m:~1%&lt;BR /&gt;
set /a feb=y%%4&lt;BR /&gt;
if %feb%==0 (set feb=29) else (set feb=28)&lt;BR /&gt;
set /a tok=m-1&lt;BR /&gt;
if %tok%==0 set tok=12&lt;BR /&gt;
for /f "tokens=%tok%" %%i in ("31 %feb% 31 30 31 30 31 31 30 31 30 31") do (&lt;BR /&gt;
:: минус 1 month  set /a m-=1&lt;BR /&gt;
   set /a m-=1&lt;BR /&gt;
    if !d!==0 (&lt;BR /&gt;
        set d=%%i&lt;BR /&gt;
        set m=%tok%&lt;BR /&gt;
        if !m!==12 set /a y-=1&lt;BR /&gt;
    )&lt;BR /&gt;
)&lt;BR /&gt;
set d=0%d%&lt;BR /&gt;
set m=0%m%&lt;BR /&gt;
set lastmonth=%y%-%m:~-2% &lt;BR /&gt;
echo %lastmonth% &amp;gt; out.txt&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 06:07:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-Why-does-the-following-error-appear-when-I/m-p/420875#M74050</guid>
      <dc:creator>atyshke1</dc:creator>
      <dc:date>2018-08-27T06:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Universal Forwarder: Why does the following error appear when I launch a batch file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-Why-does-the-following-error-appear-when-I/m-p/420876#M74051</link>
      <description>&lt;P&gt;So the error was because I used script file: runbase.path with the same name for two application.&lt;BR /&gt;
We need use different name for each application. For example for App1 we need use name runbase_App1.path for second App2 name runbase_App2.path and so on..&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:13:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-Why-does-the-following-error-appear-when-I/m-p/420876#M74051</guid>
      <dc:creator>atyshke1</dc:creator>
      <dc:date>2020-09-29T22:13:41Z</dc:date>
    </item>
  </channel>
</rss>

