<?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: Deploy custom script, then upload the results in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Deploy-custom-script-then-upload-the-results/m-p/297975#M93742</link>
    <description>&lt;P&gt;The easiest ways I can think that would solve this for you (If I understand the question correctly), would be to either monitor stdout of the netstat script, or write the results to a file and monitor that file.&lt;/P&gt;

&lt;P&gt;Here are some suggested steps:&lt;/P&gt;

&lt;P&gt;-Create a new app.  &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptedInputsIntro"&gt;Follow the instructions for Scripted Inputs&lt;/A&gt;.  In general:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Under /etc/deployment-apps/ , create a new app, for example: myapp .&lt;/LI&gt;
&lt;LI&gt;Under /etc/deployment-apps/myapp/bin , place your .sh script.  Out of the box, Splunk should be able to run it.  Make sure to add the correct interpreter in the first line (usually /bin/bash).&lt;/LI&gt;
&lt;LI&gt;You can output the script to a file, and have Splunk monitor that file (“Writing data to a file for indexing”).  Another – quick – alternative would be to echo your netstat results to stdout (“Streaming data”).  The Splunk service, which runs your script, will watch stdout and will send it back to the indexer as a single event.&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Mon, 20 Nov 2017 00:08:23 GMT</pubDate>
    <dc:creator>98123722</dc:creator>
    <dc:date>2017-11-20T00:08:23Z</dc:date>
    <item>
      <title>Deploy custom script, then upload the results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Deploy-custom-script-then-upload-the-results/m-p/297974#M93741</link>
      <description>&lt;P&gt;Newbie here. How can I output the result of a bash script back into Splunk? The script periodically sends netstat commands.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Nov 2017 20:34:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Deploy-custom-script-then-upload-the-results/m-p/297974#M93741</guid>
      <dc:creator>mlorrette</dc:creator>
      <dc:date>2017-11-19T20:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Deploy custom script, then upload the results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Deploy-custom-script-then-upload-the-results/m-p/297975#M93742</link>
      <description>&lt;P&gt;The easiest ways I can think that would solve this for you (If I understand the question correctly), would be to either monitor stdout of the netstat script, or write the results to a file and monitor that file.&lt;/P&gt;

&lt;P&gt;Here are some suggested steps:&lt;/P&gt;

&lt;P&gt;-Create a new app.  &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptedInputsIntro"&gt;Follow the instructions for Scripted Inputs&lt;/A&gt;.  In general:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Under /etc/deployment-apps/ , create a new app, for example: myapp .&lt;/LI&gt;
&lt;LI&gt;Under /etc/deployment-apps/myapp/bin , place your .sh script.  Out of the box, Splunk should be able to run it.  Make sure to add the correct interpreter in the first line (usually /bin/bash).&lt;/LI&gt;
&lt;LI&gt;You can output the script to a file, and have Splunk monitor that file (“Writing data to a file for indexing”).  Another – quick – alternative would be to echo your netstat results to stdout (“Streaming data”).  The Splunk service, which runs your script, will watch stdout and will send it back to the indexer as a single event.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 20 Nov 2017 00:08:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Deploy-custom-script-then-upload-the-results/m-p/297975#M93742</guid>
      <dc:creator>98123722</dc:creator>
      <dc:date>2017-11-20T00:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Deploy custom script, then upload the results</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Deploy-custom-script-then-upload-the-results/m-p/297976#M93743</link>
      <description>&lt;P&gt;Simple : &lt;/P&gt;

&lt;P&gt;Wire up your script using the Command Modular Input&lt;/P&gt;

&lt;P&gt;&lt;A href="https://splunkbase.splunk.com/app/1553/"&gt;https://splunkbase.splunk.com/app/1553/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3895i65BFE4715CBC2360/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Of course you can also refactor your script into a Splunk Scripted Input or Modular Input and deploy it in it's own App , but if you simply want to execute your script as is and capture the STDOUT in Splunk , then the Command Modular Input will work. And has some advanced stuff like plugging in your own preprocessing if you want.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 00:26:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Deploy-custom-script-then-upload-the-results/m-p/297976#M93743</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2017-11-20T00:26:12Z</dc:date>
    </item>
  </channel>
</rss>

