<?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: Scripted input permission denied in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383079#M69002</link>
    <description>&lt;P&gt;Is there a way I can adjust the script to have splunk read the stream and index it, rather than save the file locally then index it?&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2019 01:51:39 GMT</pubDate>
    <dc:creator>DEAD_BEEF</dc:creator>
    <dc:date>2019-07-10T01:51:39Z</dc:date>
    <item>
      <title>Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383068#M68991</link>
      <description>&lt;P&gt;Hello.  I have a HF and I want it to download a .csv file from another internal server.  Right now, I can download it as the splunk user using &lt;CODE&gt;wget&lt;/CODE&gt; on CLI so I know connectivity and permissions are no issue.  I looked at scripted inputs but I don't think that's the right way about it, as I can't get it to work.  Not sure how to go about this?&lt;/P&gt;

&lt;P&gt;I just want to download a csv file and then send it to my indexer tier.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;/opt/splunk/etc/apps/my_app/bin/script.sh&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/usr/bin/wget -O file.csv 'https://myserver.com/feeds/list?v=csv&amp;amp;f=indicator&amp;amp;tr=1'
exit 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;/opt/splunk/etc/apps/my_app/local/inputs.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://./bin/script.sh]
index = main
sourcetype = test
interval = 600.0
disabled = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;splunkd.log&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;07-10-2019 00:08:18.082 +0000 ERROR ExecProcessor - message from "/opt/splunk/etc/apps/my_app/bin/script.sh" file.csv: Permission denied
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I checked and the app is owned by splunk:splunk.  The script is 755.  I ran the ad-hoc command below as the splunk user and it downloaded the file just fine&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/opt/splunk/bin/splunk cmd ../etc/apps/my_app/bin/script.sh
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried adding the input through the HF's gui (Settings &amp;gt; Data Inputs &amp;gt; Scripts &amp;gt; Add new) but my app and script are not showing up in the dropdown...&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/7309i248EE355F0EED336/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 00:20:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383068#M68991</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2019-07-10T00:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383069#M68992</link>
      <description>&lt;P&gt;can you check the level of permission on "script.sh". does it have execute permissions?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 00:23:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383069#M68992</guid>
      <dc:creator>nabeel652</dc:creator>
      <dc:date>2019-07-10T00:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383070#M68993</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;-rwxr-xr-x. 1 splunk splunk  217 Jul  9 23:35 script.sh
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2019 00:27:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383070#M68993</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2019-07-10T00:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383071#M68994</link>
      <description>&lt;P&gt;Hi DEAD_BEEF,&lt;/P&gt;

&lt;P&gt;it's not the script that is the issue here, it's the output file &lt;CODE&gt;file.csv&lt;/CODE&gt; AND it's location the script is trying to create it. Set the output file to use a full path that you are sure the user &lt;CODE&gt;splunk&lt;/CODE&gt; can write into.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 01:11:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383071#M68994</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-07-10T01:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383072#M68995</link>
      <description>&lt;P&gt;Some things to try:&lt;BR /&gt;
    Try using $SPLUNK_HOME to set the path to your script in inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[script://$SPLUNK_HOME/etc/apps/myapp/bin/script.sh]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If still failing, try adding  a wrapper script to call the other script to help with logging/debugging.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#wrapper-script.sh
SCRIPT_DIR=$SPLUNK_HOME/apps/my_app/bin
LOG_FILE=$SPLUNK_HOME/var/log/splunk/wrapper-script.log
# execute script and log standard out and standard error 
$SCRIPT_DIR/script.sh 2&amp;gt;&amp;amp;1 &amp;gt; $LOG_FILE
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2019 01:24:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383072#M68995</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2019-07-10T01:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383073#M68996</link>
      <description>&lt;P&gt;If I just want splunk to read the stream and then send it to indexers rather than download a log file and then send it, how would I adjust the script?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 01:30:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383073#M68996</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2019-07-10T01:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383074#M68997</link>
      <description>&lt;P&gt;Good point &lt;CODE&gt;-O file.csv&lt;/CODE&gt; possibly should have a specific path before the file name (where the file should be written) unless preceded with a &lt;CODE&gt;cd some dir&lt;/CODE&gt; command&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 01:31:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383074#M68997</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2019-07-10T01:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383075#M68998</link>
      <description>&lt;P&gt;Also note if you are going to call/access the script from the UI i.e. scripted alert action etc., It will only be accessible from your specific app space &lt;CODE&gt;my_app&lt;/CODE&gt; etc. Place the script in $SPLUNK_HOME/bin/scripts and restart instance if you are wanting it to be accessible to all app spaces from the UI.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 01:36:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383075#M68998</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2019-07-10T01:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383076#M68999</link>
      <description>&lt;P&gt;No &lt;CODE&gt;-O&lt;/CODE&gt;, everything that goes to &lt;CODE&gt;stdout&lt;/CODE&gt; will be indexed by Splunk when running scripted/modular inputs.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 01:39:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383076#M68999</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-07-10T01:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383077#M69000</link>
      <description>&lt;P&gt;Splunk can index whatever is returned to standard out as a scripted input.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;wget -O - 'https://myserver.com/feeds/list?v=csv&amp;amp;f=indicator&amp;amp;tr=1' 2&amp;gt; /dev/null
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or, if you want to redirect standard error output also:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;wget -O - 'https://myserver.com/feeds/list?v=csv&amp;amp;f=indicator&amp;amp;tr=1'  2&amp;gt;&amp;amp;1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2019 01:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383077#M69000</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2019-07-10T01:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383078#M69001</link>
      <description>&lt;P&gt;So I put a full path &lt;CODE&gt;/var/log/file.txt&lt;/CODE&gt; and now the file is saved on the HF, but nothing was indexed...&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 01:48:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383078#M69001</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2019-07-10T01:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383079#M69002</link>
      <description>&lt;P&gt;Is there a way I can adjust the script to have splunk read the stream and index it, rather than save the file locally then index it?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 01:51:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383079#M69002</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2019-07-10T01:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383080#M69003</link>
      <description>&lt;P&gt;Every output to stdout from a script that is run by Splunk will be indexed. Simply make your script to output to stdout and you will have the output indexed.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 02:01:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383080#M69003</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-07-10T02:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383081#M69004</link>
      <description>&lt;P&gt;@rob_jordan I changed the script to just be the 1-liner that you put (as I didn't know how to send data to stdout).  Now it shows this and no data in index=main&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;07-10-2019 02:07:56.729 +0000 ERROR ExecProcessor - message from "/opt/splunk/etc/apps/my_app/bin/script.sh" 2019-07-10 02:07:56 (8.61 MB/s) - written to stdout [4011976]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2019 02:12:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383081#M69004</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2019-07-10T02:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383082#M69005</link>
      <description>&lt;P&gt;Hi, I am sending to stdout now using what @rob_jordan said (as I didn't know how).  I don't see data in main index but seeing this log.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;07-10-2019 02:07:56.729 +0000 ERROR ExecProcessor - message from "/opt/splunk/etc/apps/my_app/bin/script.sh" 2019-07-10 02:07:56 (8.61 MB/s) - written to stdout [4011976]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2019 02:15:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383082#M69005</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2019-07-10T02:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383083#M69006</link>
      <description>&lt;P&gt;Do you pass any timestamp with to output? Search &lt;CODE&gt;all time&lt;/CODE&gt; in &lt;CODE&gt;main&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 02:16:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383083#M69006</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-07-10T02:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383084#M69007</link>
      <description>&lt;P&gt;Might be also worth to read this here &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptWriting"&gt;https://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ScriptWriting&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 02:18:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383084#M69007</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2019-07-10T02:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383085#M69008</link>
      <description>&lt;P&gt;I checked &lt;CODE&gt;all time&lt;/CODE&gt; with &lt;CODE&gt;index=main sourcetype=test&lt;/CODE&gt; and nothing...  Also, no timestamps in this data.  I assumed Splunk will write the index time for all the events in the file.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 02:26:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383085#M69008</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2019-07-10T02:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted input permission denied</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383086#M69009</link>
      <description>&lt;P&gt;Okay, I got it.  outputting it to /dev/null caused it to send stdout to the trash.  I removed that, but left the &lt;CODE&gt;wget -O- ...&lt;/CODE&gt; and it started indexing immediately.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 04:02:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Scripted-input-permission-denied/m-p/383086#M69009</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2019-07-10T04:02:12Z</dc:date>
    </item>
  </channel>
</rss>

