<?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: Running a .sh script from a remote machine in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435507#M1476</link>
    <description>&lt;P&gt;Hi @Fulljames,&lt;/P&gt;

&lt;P&gt;You could do it by using normal unix script and use a scheduler to run that in splunk using &lt;BR /&gt;
 &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.1/AdvancedDev/ScriptedInputsIntro"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.1/AdvancedDev/ScriptedInputsIntro&lt;/A&gt;  and &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.1/AdvancedDev/ScriptSetup"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.1/AdvancedDev/ScriptSetup&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Ideally you would do &lt;CODE&gt;RESULTS=$(ssh user@server  /path/to/the/script/script.sh)&lt;/CODE&gt; and push the RESULT to splunk by using a log file or as direct stream . You shall do output sanitizing before you "echo" the RESULT&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jul 2018 16:38:53 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2018-07-11T16:38:53Z</dc:date>
    <item>
      <title>Running a .sh script from a remote machine</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435506#M1475</link>
      <description>&lt;P&gt;I am looking at running a .sh script which is stored on a remote machine I am hoping to run this script every couple of hours and then log the output with splunk so we can utilise the script to our advantage. Is this possible with splunk as I have not come across any useful documentation.&lt;/P&gt;

&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 15:57:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435506#M1475</guid>
      <dc:creator>Fulljames</dc:creator>
      <dc:date>2018-07-11T15:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Running a .sh script from a remote machine</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435507#M1476</link>
      <description>&lt;P&gt;Hi @Fulljames,&lt;/P&gt;

&lt;P&gt;You could do it by using normal unix script and use a scheduler to run that in splunk using &lt;BR /&gt;
 &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.1/AdvancedDev/ScriptedInputsIntro"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.1/AdvancedDev/ScriptedInputsIntro&lt;/A&gt;  and &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.1/AdvancedDev/ScriptSetup"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.1/AdvancedDev/ScriptSetup&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Ideally you would do &lt;CODE&gt;RESULTS=$(ssh user@server  /path/to/the/script/script.sh)&lt;/CODE&gt; and push the RESULT to splunk by using a log file or as direct stream . You shall do output sanitizing before you "echo" the RESULT&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 16:38:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435507#M1476</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-07-11T16:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Running a .sh script from a remote machine</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435508#M1477</link>
      <description>&lt;P&gt;Hi @renjith.nair&lt;/P&gt;

&lt;P&gt;Thanks for your response!&lt;BR /&gt;
Im very new to splunk so I will need a .config file with the &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;RESULTS=$(ssh user@server /path/to/the/script/script.sh)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to identify the location of the .sh file, additionally would I need to specify the password?&lt;/P&gt;

&lt;P&gt;I looked over the links you mentioned:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://$SPLUNK_HOME/etc/apps/&amp;lt;appName&amp;gt;/bin/starter_script.sh]
disabled = true # change to false to start the input, requires restart
host = # enter hostname here
index = main
interval = 30    #frequency to run the script, in seconds
source = my_db
sourcetype = my_db_data
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Would the:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://$SPLUNK_HOME/etc/apps/&amp;lt;appName&amp;gt;/bin/starter_script.sh]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Need to be replaced with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;RESULTS=$(ssh user@server /path/to/the/script/script.sh)?
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 10:17:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435508#M1477</guid>
      <dc:creator>Fulljames</dc:creator>
      <dc:date>2018-07-12T10:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Running a .sh script from a remote machine</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435509#M1478</link>
      <description>&lt;P&gt;Hi Fulljames,&lt;/P&gt;

&lt;P&gt;As I understand you want to take output of sh script in Splunk. The best approach would be to take output of the script in text file and append that output in text file every 5  or 10 mins as per your requirement. And then you can use that log file path(text file) to monitor in Splunk, Splunk will monitor the output of that text file. Let me know if it works for you...&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 11:27:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435509#M1478</guid>
      <dc:creator>manish_singh_77</dc:creator>
      <dc:date>2018-07-12T11:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Running a .sh script from a remote machine</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435510#M1479</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/121510"&gt;@manish_singh_77&lt;/a&gt;7 would that text file need to be stored on a local machine or could it be stored on the remote Linux machine?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435510#M1479</guid>
      <dc:creator>Fulljames</dc:creator>
      <dc:date>2020-09-29T20:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Running a .sh script from a remote machine</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435511#M1480</link>
      <description>&lt;P&gt;That doesn't matter, you can store the text file in remote linux machine, because your remote linux machine is going to have Universal forwarder and you will write inputs.conf for that, so that will work for you. Let me know if you have got any more queries..&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 13:29:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435511#M1480</guid>
      <dc:creator>manish_singh_77</dc:creator>
      <dc:date>2018-07-12T13:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Running a .sh script from a remote machine</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435512#M1481</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/121510"&gt;@manish_singh_77&lt;/a&gt;7 Thanks for your reponse! Where do I upload the inputs.conf file and within this file I looked over the link you supplied and do I just need to implement: &lt;CODE&gt;[monitor://&amp;lt;path&amp;gt;]&lt;/CODE&gt; could you please expand on this as I think this is the main problem in getting this working? Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:25:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435512#M1481</guid>
      <dc:creator>Fulljames</dc:creator>
      <dc:date>2020-09-29T20:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Running a .sh script from a remote machine</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435513#M1482</link>
      <description>&lt;P&gt;Nope, whatever you plan to do for the remote connection and result extraction will be in another script, let's say "getRemote.sh". Now you will add this to your inputs.conf as mentioned in the doc &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.1/admin/Inputsconf#Scripted_Input:"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.1/admin/Inputsconf#Scripted_Input:&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 14:53:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435513#M1482</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-07-12T14:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Running a .sh script from a remote machine</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435514#M1483</link>
      <description>&lt;P&gt;@mnaish_singh_777 also I am using the free version of splunk, I just noticed the documentation you supplied was from Splunk enterprise, is this still applicable to splunk free? Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:25:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435514#M1483</guid>
      <dc:creator>Fulljames</dc:creator>
      <dc:date>2020-09-29T20:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running a .sh script from a remote machine</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435515#M1484</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;We  write "log file monitoring" path in "inputs.conf" stanzas only. &lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 05:39:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Running-a-sh-script-from-a-remote-machine/m-p/435515#M1484</guid>
      <dc:creator>manish_singh_77</dc:creator>
      <dc:date>2018-07-13T05:39:34Z</dc:date>
    </item>
  </channel>
</rss>

