<?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 splunk shell scripted input not working in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/splunk-shell-scripted-input-not-working/m-p/304984#M57498</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;`!/bin/sh
touch $SPLUNK_HOME/etc/apps/check-status-inputs/status.txt
SERVICE_STATUS=`systemctl status stackdriver-agent | grep active &amp;amp;&amp;gt; /dev/null`
STATUS=$?
if [ ${STATUS} -eq 0 ]
then
echo "${SERVICE_STATUS}"
else
#echo "Service is not running.."
status_new="Service is not running.."
fi
my_hostname=`hostname`
cur_date=`date`
echo "$cur_date - $my_hostname - $status_new" &amp;gt;&amp;gt; $SPLUNK_HOME/etc/apps/check-status-inputs/status.txt
#echo "$cur_date - $my_hostname - $status_new"`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hello All,&lt;/P&gt;

&lt;P&gt;i have created app with a script which creates a text file and write the output of the script to that text file and reads the event from file and send to splunk. i'm doing all this using splunk universal forwarder.  if run it manually it is working fine but not if i use inputs.conf. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;here is my app structure&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;$SPLUNK_HOME/etc/apps --&amp;gt;&lt;BR /&gt;
                                                     check-status-inputs --&amp;gt;&lt;BR /&gt;
                                                                                                bin  local  metadata&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;and my inputs.conf is&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;[script://./bin/check_status.sh]&lt;/P&gt;

&lt;H1&gt;disabled = false&lt;/H1&gt;

&lt;P&gt;sourcetype = status&lt;BR /&gt;
index=tool_status&lt;BR /&gt;
interval = 30&lt;/P&gt;

&lt;P&gt;please let me know if am doing any mistake. &lt;BR /&gt;
Thanks for the Help!!!!!&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jan 2018 20:32:39 GMT</pubDate>
    <dc:creator>saifuddin9122</dc:creator>
    <dc:date>2018-01-12T20:32:39Z</dc:date>
    <item>
      <title>splunk shell scripted input not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/splunk-shell-scripted-input-not-working/m-p/304984#M57498</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;`!/bin/sh
touch $SPLUNK_HOME/etc/apps/check-status-inputs/status.txt
SERVICE_STATUS=`systemctl status stackdriver-agent | grep active &amp;amp;&amp;gt; /dev/null`
STATUS=$?
if [ ${STATUS} -eq 0 ]
then
echo "${SERVICE_STATUS}"
else
#echo "Service is not running.."
status_new="Service is not running.."
fi
my_hostname=`hostname`
cur_date=`date`
echo "$cur_date - $my_hostname - $status_new" &amp;gt;&amp;gt; $SPLUNK_HOME/etc/apps/check-status-inputs/status.txt
#echo "$cur_date - $my_hostname - $status_new"`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hello All,&lt;/P&gt;

&lt;P&gt;i have created app with a script which creates a text file and write the output of the script to that text file and reads the event from file and send to splunk. i'm doing all this using splunk universal forwarder.  if run it manually it is working fine but not if i use inputs.conf. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;here is my app structure&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;$SPLUNK_HOME/etc/apps --&amp;gt;&lt;BR /&gt;
                                                     check-status-inputs --&amp;gt;&lt;BR /&gt;
                                                                                                bin  local  metadata&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;and my inputs.conf is&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;[script://./bin/check_status.sh]&lt;/P&gt;

&lt;H1&gt;disabled = false&lt;/H1&gt;

&lt;P&gt;sourcetype = status&lt;BR /&gt;
index=tool_status&lt;BR /&gt;
interval = 30&lt;/P&gt;

&lt;P&gt;please let me know if am doing any mistake. &lt;BR /&gt;
Thanks for the Help!!!!!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 20:32:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/splunk-shell-scripted-input-not-working/m-p/304984#M57498</guid>
      <dc:creator>saifuddin9122</dc:creator>
      <dc:date>2018-01-12T20:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: splunk shell scripted input not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/splunk-shell-scripted-input-not-working/m-p/304985#M57499</link>
      <description>&lt;P&gt;Please edit your question to format your code.  Highlight it and click the code button (labeled 101010).&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 21:10:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/splunk-shell-scripted-input-not-working/m-p/304985#M57499</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-01-12T21:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: splunk shell scripted input not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/splunk-shell-scripted-input-not-working/m-p/304986#M57500</link>
      <description>&lt;P&gt;The posted script won't return anything to splunk.  Instead it writes to a file (that you probably don't have Splunk configured to monitor).  I see commented out lines that suggest you may have tried this or something similar, but try having your script only echo to stdout instead of redirecting to a file.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 21:34:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/splunk-shell-scripted-input-not-working/m-p/304986#M57500</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-01-12T21:34:49Z</dc:date>
    </item>
  </channel>
</rss>

