<?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: Error when running CLI remotely in Security</title>
    <link>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101027#M14256</link>
    <description>&lt;P&gt;Not very familiar with editing this stuff from the CLI, but it might be possible that Splunk is matching on the literal &lt;CODE&gt;$SPLUNK_HOME&lt;/CODE&gt; string, not what it happens to expand to. Did you try using &lt;CODE&gt;$SPLUNK_HOME&lt;/CODE&gt; in your command?&lt;/P&gt;</description>
    <pubDate>Thu, 25 Oct 2012 09:27:20 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2012-10-25T09:27:20Z</dc:date>
    <item>
      <title>Error when running CLI remotely</title>
      <link>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101022#M14251</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;

&lt;P&gt;When i run CLI remotely to indexer as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk edit exec "c:\Program Files\Splunk\etc\system\bin\memory.bat" -interval 50 -uri https:\\192.168.64.4:8089
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I got error saying: "in handle 'script': cannot edit input "c:\Program Files\Splunk\etc\system\bin\memory.bat", no input exist with that name"&lt;/P&gt;

&lt;P&gt;But i have configured inputs.conf in indexer as below:&lt;/P&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  [script://$SPLUNK_HOME\etc\system\bin\memory.bat]
    interval = 80
    index = default
    disabled = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can i solve that ?&lt;/P&gt;

&lt;P&gt;Another is when i change script's interval, is it triggered right away or waiting for the end of first time of new interval ?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2012 12:54:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101022#M14251</guid>
      <dc:creator>sieutruc</dc:creator>
      <dc:date>2012-10-24T12:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error when running CLI remotely</title>
      <link>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101023#M14252</link>
      <description>&lt;P&gt;Given that the output you're seeing has the backslashes removed, my best guess is that you'll need to use double back slashes in the path, probably on the CLI rather than in inputs.conf.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Eg: "C:\\Program Files\\Splunk\\etc\\system\\bin\\memory.bat"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alternatively, use forward slashes.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2012 15:22:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101023#M14252</guid>
      <dc:creator>Yorokobi</dc:creator>
      <dc:date>2012-10-24T15:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Error when running CLI remotely</title>
      <link>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101024#M14253</link>
      <description>&lt;P&gt;Thanks, but i did but it gives the same error , have you ever done it yet ?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2012 17:57:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101024#M14253</guid>
      <dc:creator>sieutruc</dc:creator>
      <dc:date>2012-10-24T17:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error when running CLI remotely</title>
      <link>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101025#M14254</link>
      <description>&lt;P&gt;So is your CLI from Linux to Windows, Linux to Linux, or Windows to Linux? Guessing it Linux to Windows.  &lt;/P&gt;

&lt;P&gt;Windows will interperate '/' same as '\'. Try replacing with the forward slash.  Else I look into it some more, let me know.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 00:08:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101025#M14254</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2012-10-25T00:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error when running CLI remotely</title>
      <link>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101026#M14255</link>
      <description>&lt;P&gt;i tried all possible separators /, //, \,\\ , They didn't work. I run CLI from Windows to Windows for testing.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 09:21:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101026#M14255</guid>
      <dc:creator>sieutruc</dc:creator>
      <dc:date>2012-10-25T09:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error when running CLI remotely</title>
      <link>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101027#M14256</link>
      <description>&lt;P&gt;Not very familiar with editing this stuff from the CLI, but it might be possible that Splunk is matching on the literal &lt;CODE&gt;$SPLUNK_HOME&lt;/CODE&gt; string, not what it happens to expand to. Did you try using &lt;CODE&gt;$SPLUNK_HOME&lt;/CODE&gt; in your command?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 09:27:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101027#M14256</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-25T09:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error when running CLI remotely</title>
      <link>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101028#M14257</link>
      <description>&lt;P&gt;$SPLUNK_HOME is just defined global variable, so substituting it into that command doesn't get better. &lt;/P&gt;

&lt;P&gt;Why the set of CLI of Splunk is so limited. It is possible to use Splunk web to active/deactive scripted input whenever need (this isn't documented in any document i believe), as well as changing interval, sourcetype... Maybe the document of this set of CLI doesn't completely be done.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 11:27:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101028#M14257</guid>
      <dc:creator>sieutruc</dc:creator>
      <dc:date>2012-10-25T11:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error when running CLI remotely</title>
      <link>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101029#M14258</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/27848"&gt;@sieutruc&lt;/a&gt;,  Ok I think I figured this one out.  I've tested this on Splunk 4.3.3 with Linux to Windows and vice versa. Apparrently if you use single or double quotes ( ' or  ") around the source in add or edit within exec the CLI bombs out remotely and locally.  And you add recieve the following error even though the path is legit.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
#ERROR producing commands&lt;BR /&gt;
splunk add exec "C:/Program Files/SplunkUniversalForwarder/etc/system/bin/test.bat" -interval 50&lt;BR /&gt;
OR&lt;BR /&gt;
splunk add exec "$SPLUNK_HOME/etc/system/bin/test.bat" -interval 50&lt;BR /&gt;
OR&lt;BR /&gt;
splunk add exec '$SPLUNK_HOME\etc\system\bin\test.bat' -interval 50&lt;BR /&gt;
OR&lt;BR /&gt;
splunk add exec "C:\Program Files\SplunkUniversalForwarder\etc\system\bin\test.bat" -interval 50&lt;BR /&gt;
OR&lt;BR /&gt;
splunk edit exec '$SPLUNK_HOME\etc\system\bin\test.bat' -interval 80&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
#ERRORS in splunkd.log&lt;BR /&gt;
ERROR FrameworkUtils - Incorrect path to script: C:\$SPLUNK_HOME\etc\system\bin\test.bat.  Script must be in a bin subdirectory in $SPLUNK_HOME.&lt;BR /&gt;
OR &lt;BR /&gt;
ERROR FrameworkUtils - Incorrect path to script: C:\Program Files\SplunkUniversalForwarder\etc\system\bin\test.bat.  Script must be in a bin subdirectory in $SPLUNK_HOME.&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
&lt;STRONG&gt;Working CLI Commands&lt;/STRONG&gt;&lt;BR /&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
#WORKING STRINGS&lt;BR /&gt;
splunk add exec $SPLUNK_HOME\etc\system\bin\test2.bat -interval 60 -uri &lt;A href="https://xxxxxx.xxx.167:8089" target="_blank"&gt;https://xxxxxx.xxx.167:8089&lt;/A&gt;&lt;BR /&gt;
Configuration updated: '$SPLUNK_HOME\etc\system\bin\test2.bat' has been added for execution.&lt;BR /&gt;
OR&lt;BR /&gt;
splunk edit exec $SPLUNK_HOME\etc\system\bin\test2.bat -interval 80 -uri &lt;A href="https://xxx.xxx.xxx.167:8089" target="_blank"&gt;https://xxx.xxx.xxx.167:8089&lt;/A&gt;&lt;BR /&gt;
Configuration updated for '$SPLUNK_HOME\etc\system\bin\test2.bat'.&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;This seems like a bug to me.  If you cant quote a parameter how do you handle spaces?&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:41:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101029#M14258</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2020-09-28T12:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error when running CLI remotely</title>
      <link>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101030#M14259</link>
      <description>&lt;P&gt;i don't know , but i executed:&lt;BR /&gt;
splunk edit exec "c:\Program Files\Splunk\etc\system\bin\memory.bat" -interval 50 -uri https:\\192.168.64.4:8089&lt;/P&gt;

&lt;P&gt;from window 7 to windows 2003, it run smoothly .&lt;/P&gt;

&lt;P&gt;But i run your successful command:&lt;/P&gt;

&lt;P&gt;splunk add exec $SPLUNK_HOME\etc\system\bin\test2.bat -interval 60 -uri &lt;A href="https://xxxxxx.xxx.167:8089"&gt;https://xxxxxx.xxx.167:8089&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;i got an error:10-26-2012 01:37:43.196 +0200 ERROR AdminHandler:Exec - The file "C:\Program Files\Splunk\bin\scripts\/opt/splunketcsystembintets.bat" does not exist. (from Opensuse to windows 2003)&lt;/P&gt;

&lt;P&gt;it's so weird,how Splunk handle parameter on linux ?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 23:44:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101030#M14259</guid>
      <dc:creator>sieutruc</dc:creator>
      <dc:date>2012-10-25T23:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Error when running CLI remotely</title>
      <link>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101031#M14260</link>
      <description>&lt;P&gt;Not sure. I am using REDHAT and 2k8 Server Core.  &lt;/P&gt;

&lt;P&gt;You could try passing the Windows Program Files short path.&lt;BR /&gt;
C:\PROGRA~1\splunk\etc\system\bin\yourbat.bat .Or within a sh script set your $SPLUNK_HOME temporarily to C:\Program Files\Splunk\.&lt;/P&gt;

&lt;P&gt;You might need to open a case with support at this point. Sorry I couldnt be of more help.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2012 00:29:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Error-when-running-CLI-remotely/m-p/101031#M14260</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2012-10-26T00:29:23Z</dc:date>
    </item>
  </channel>
</rss>

