<?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: Variable for Splunk install directory in deployed scripts in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104762#M22855</link>
    <description>&lt;P&gt;Because inputs.conf supports the $SPLUNK_HOME variable.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2013 17:51:59 GMT</pubDate>
    <dc:creator>rtadams89</dc:creator>
    <dc:date>2013-10-17T17:51:59Z</dc:date>
    <item>
      <title>Variable for Splunk install directory in deployed scripts</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104758#M22851</link>
      <description>&lt;P&gt;I need to run a vbs script on some of my Windows Forwarders. To do so, I have deployed a batch script that calls the vbs script with the following code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;@echo off
cscript //nologo "C:\Program Files\SplunkUniversalForwarder\etc\apps\my-test-app\bin\script.vbs"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is that the Splunk Universal Forwarder may be running from a location other than c:\program files.&lt;/P&gt;

&lt;P&gt;Is there any way to get the directory Splunk is running from within the bat wrapper script and use that to provide the correct path to the vbs script file?&lt;/P&gt;

&lt;P&gt;PS: I am aware of the environmental variables for "Program Files", but I would like to cover the cases where Splunk is installed to an arbitrary directory, perhaps not even in the Program Files folder.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 17:27:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104758#M22851</guid>
      <dc:creator>rtadams89</dc:creator>
      <dc:date>2013-10-17T17:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Variable for Splunk install directory in deployed scripts</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104759#M22852</link>
      <description>&lt;P&gt;Why not declare a environment variable as you know where the splunk forwarder installed. and replace them until \etc. Any reason why it can't happen?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 17:35:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104759#M22852</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-10-17T17:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Variable for Splunk install directory in deployed scripts</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104760#M22853</link>
      <description>&lt;P&gt;I don't know where Splunk is installed on each host.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 17:38:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104760#M22853</guid>
      <dc:creator>rtadams89</dc:creator>
      <dc:date>2013-10-17T17:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Variable for Splunk install directory in deployed scripts</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104761#M22854</link>
      <description>&lt;P&gt;Then how are you going to configure the scripts in inputs.conf? If you are just looking for the directory, a simple vb script to check on the splunk registry to get the installed path.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 17:43:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104761#M22854</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-10-17T17:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Variable for Splunk install directory in deployed scripts</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104762#M22855</link>
      <description>&lt;P&gt;Because inputs.conf supports the $SPLUNK_HOME variable.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 17:51:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104762#M22855</guid>
      <dc:creator>rtadams89</dc:creator>
      <dc:date>2013-10-17T17:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Variable for Splunk install directory in deployed scripts</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104763#M22856</link>
      <description>&lt;P&gt;Figured it out. I ended up using the variable "%~dp0" inside the patch script. This will return the path to the directory the batch script is located in. By appending the name of my vbs file to that, I end up with the full path to the vbs file.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 17:53:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Variable-for-Splunk-install-directory-in-deployed-scripts/m-p/104763#M22856</guid>
      <dc:creator>rtadams89</dc:creator>
      <dc:date>2013-10-17T17:53:18Z</dc:date>
    </item>
  </channel>
</rss>

