<?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: creating a deployment app to push and run a bash script in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456991#M68199</link>
    <description>&lt;P&gt;On my deployment server i have:&lt;/P&gt;

&lt;P&gt;/opt/splunk/etc/deployment-apps/metrics&lt;BR /&gt;
    and within that path, folders bin, default, and local&lt;/P&gt;

&lt;P&gt;my script is in the bin folder&lt;BR /&gt;
and my inputs.conf file is in the default folder&lt;/P&gt;

&lt;P&gt;The contents of my inputs.conf file is:&lt;/P&gt;

&lt;P&gt;[script://$SPLUNK_HOME/etc/deployment-apps/metrics/bin/metrics.sh]&lt;BR /&gt;
disabled = 0 &lt;BR /&gt;
interval = 60&lt;BR /&gt;
source = /opt/splunkforwarder/var/log/splunk/metrics.log&lt;BR /&gt;
sourcetype = splunkd&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2019 02:14:37 GMT</pubDate>
    <dc:creator>agentguerry</dc:creator>
    <dc:date>2019-05-17T02:14:37Z</dc:date>
    <item>
      <title>creating a deployment app to push and run a bash script</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456987#M68195</link>
      <description>&lt;P&gt;Is it possible to create a splunk deployment app that i can push out to my forwarders that will run a bash script every  minute to gather facts and push them to a log?&lt;/P&gt;

&lt;P&gt;I have looked at some of the documentation, and created an app, placed my bash script in the /opt/splunk/etc/deployment-apps/myapp/bin/script.sh&lt;/P&gt;

&lt;P&gt;I can see that it gets deployed to my test server, but i see in my splunkd.log that i get &lt;/P&gt;

&lt;P&gt;"Incorrect path to script: /opt/splunk/etc/deployment-apps/myapp/bin/script.sh Script must be inside $SPLUNK_HOME/bin/scripts".&lt;/P&gt;

&lt;P&gt;my default/inputs.conf file has:&lt;/P&gt;

&lt;P&gt;[script://path to the script]&lt;BR /&gt;
disabled=0&lt;BR /&gt;
interval=60&lt;BR /&gt;
sourcetype=splunkd&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 19:21:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456987#M68195</guid>
      <dc:creator>agentguerry</dc:creator>
      <dc:date>2019-05-16T19:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: creating a deployment app to push and run a bash script</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456988#M68196</link>
      <description>&lt;P&gt;A similar issue at &lt;A href="https://answers.splunk.com/answers/238248/correct-location-for-splunk-input-scripts-and-trou.html"&gt;Correct Location for Splunk Input Scripts and troubleshooting&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Looking at my deployment server and I have a couple with -&lt;BR /&gt;
&lt;CODE&gt;$SPLUNK_HOME/etc/deployment-apps/&amp;lt;my app&amp;gt;/bin&lt;/CODE&gt; in which the various &lt;CODE&gt;.sh&lt;/CODE&gt; exist.  &lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 19:56:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456988#M68196</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-05-16T19:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: creating a deployment app to push and run a bash script</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456989#M68197</link>
      <description>&lt;P&gt;Can you check what have you put as &lt;CODE&gt;path to the script&lt;/CODE&gt;  ? It is quite important to put the exact stanza in your query, so we can see if it is different&lt;/P&gt;

&lt;P&gt;The Correct way to put it is   (please check &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/AdvancedDev/ScriptSetup"&gt;this documentation&lt;/A&gt;)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://$SPLUNK_HOME/etc/apps/&amp;lt;appName&amp;gt;/bin/script.sh]
disabled = false
host = whateverHost
index = yourindex
interval = 60    #frequency to run the script, in seconds
source = my_db
sourcetype = my_db_data
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 May 2019 20:37:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456989#M68197</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-16T20:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: creating a deployment app to push and run a bash script</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456990#M68198</link>
      <description>&lt;P&gt;And in the spirit of what @koshyk said, we used a relative path in &lt;CODE&gt;inputs.conf&lt;/CODE&gt; -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [script://./bin/&amp;lt;script name&amp;gt;]
 interval = 60
 sourcetype = vmstat
 source = vmstat
 index = xxxxxx
 disabled = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Like this, these different paths in the deployment server &lt;CODE&gt;$SPLUNK_HOME/etc/deployment-apps/&amp;lt;my app&amp;gt;/bin&lt;/CODE&gt; and on the forwarder - &lt;CODE&gt;$SPLUNK_HOME/etc/apps/&amp;lt;my app&amp;gt;/bin&lt;/CODE&gt; don't confuse us.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 00:45:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456990#M68198</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-05-17T00:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: creating a deployment app to push and run a bash script</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456991#M68199</link>
      <description>&lt;P&gt;On my deployment server i have:&lt;/P&gt;

&lt;P&gt;/opt/splunk/etc/deployment-apps/metrics&lt;BR /&gt;
    and within that path, folders bin, default, and local&lt;/P&gt;

&lt;P&gt;my script is in the bin folder&lt;BR /&gt;
and my inputs.conf file is in the default folder&lt;/P&gt;

&lt;P&gt;The contents of my inputs.conf file is:&lt;/P&gt;

&lt;P&gt;[script://$SPLUNK_HOME/etc/deployment-apps/metrics/bin/metrics.sh]&lt;BR /&gt;
disabled = 0 &lt;BR /&gt;
interval = 60&lt;BR /&gt;
source = /opt/splunkforwarder/var/log/splunk/metrics.log&lt;BR /&gt;
sourcetype = splunkd&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 02:14:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456991#M68199</guid>
      <dc:creator>agentguerry</dc:creator>
      <dc:date>2019-05-17T02:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: creating a deployment app to push and run a bash script</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456992#M68200</link>
      <description>&lt;P&gt;Oh, please change it to &lt;CODE&gt;[./bin/metrics.sh]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 11:21:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456992#M68200</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-05-17T11:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: creating a deployment app to push and run a bash script</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456993#M68201</link>
      <description>&lt;P&gt;this has a working example I've used a few times;&lt;BR /&gt;
&lt;A href="https://splunkbase.splunk.com/app/2975/"&gt;https://splunkbase.splunk.com/app/2975/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://github.com/hire-vladimir/SA-syslog_collection/blob/master/default/inputs.conf"&gt;https://github.com/hire-vladimir/SA-syslog_collection/blob/master/default/inputs.conf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://github.com/hire-vladimir/SA-syslog_collection/tree/master/bin"&gt;https://github.com/hire-vladimir/SA-syslog_collection/tree/master/bin&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2019 11:32:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456993#M68201</guid>
      <dc:creator>GDustin</dc:creator>
      <dc:date>2019-05-17T11:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: creating a deployment app to push and run a bash script</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456994#M68202</link>
      <description>&lt;P&gt;that helped me. changing the path.&lt;/P&gt;

&lt;P&gt;Thank you for the assistance.&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2019 02:23:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456994#M68202</guid>
      <dc:creator>agentguerry</dc:creator>
      <dc:date>2019-05-18T02:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: creating a deployment app to push and run a bash script</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456995#M68203</link>
      <description>&lt;P&gt;Great news @agentguerry !!!&lt;/P&gt;

&lt;P&gt;Please accept the answer or upvote it, or even do both, as I do when I get really excited and cheerful.&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 01:20:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/creating-a-deployment-app-to-push-and-run-a-bash-script/m-p/456995#M68203</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-05-20T01:20:01Z</dc:date>
    </item>
  </channel>
</rss>

