<?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 Scripted Input permissions and execution troubleshooting in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510687#M2771</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I think I need help on this one....&lt;/P&gt;&lt;P&gt;We have a standalone windows system which is our indexer, management and deployment server.&amp;nbsp; &amp;nbsp;In the field, we have several flavors of devices running universal forwarders, i.e. Windows, Linux, Solaris, etc.&lt;/P&gt;&lt;P&gt;I am working on a directory monitor which will allow me to see what files are in a directory and report is one is missing or the like.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To test this, I created a scripted input to gather the contents of the directory and forward it to the indexer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;inputs.conf

###### Scripted Input to monitor directory files
[script://./bin/dircontents.sh]
disabled = 0
interval = 60
sourcetype = Script:dircontents.sh
index = filewatch&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;props.conf 

[Script:dircontents.sh]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)
MAX_EVENTS = 10000
TRUNCATE = 0
DATETIME_CONFIG = CURRENT&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;dircontents.sh

cd /u01/DeticaHome/UI/data/acquisition/waiting
ls | sort&lt;/LI-CODE&gt;&lt;P&gt;With those config files, I deploy the app without issue, but when the script runs I get the following;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal

07-23-2020 09:30:47.841 -0500 ERROR ExecProcessor - message from "/opt/splunkforwarder/etc/apps/_server_app_Detica-File-Processing-Mon/bin/dircontents.sh" /bin/sh: /opt/splunkforwarder/etc/apps/_server_app_Detica-File-Processing-Mon/bin/dircontents.sh: cannot execute&lt;/LI-CODE&gt;&lt;P&gt;It appears the permissions of the script are not correct.&amp;nbsp; I checked and the deploy script,&amp;nbsp;&amp;nbsp;dircontents.sh, permissions are 655 at deployment.&amp;nbsp; I changed the permissions to 755 manually and the script took off and started working, but this was a manual intervention which is not optimal.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;The Universal forwarder was installed and running as root.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To get this right, I need 755 permissions of the script fo the scripted input.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What have I missed?&amp;nbsp; Any insight would be great at this point.&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Rcp&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2020 15:41:32 GMT</pubDate>
    <dc:creator>raynold_peterso</dc:creator>
    <dc:date>2020-07-23T15:41:32Z</dc:date>
    <item>
      <title>Scripted Input permissions and execution troubleshooting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510687#M2771</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I think I need help on this one....&lt;/P&gt;&lt;P&gt;We have a standalone windows system which is our indexer, management and deployment server.&amp;nbsp; &amp;nbsp;In the field, we have several flavors of devices running universal forwarders, i.e. Windows, Linux, Solaris, etc.&lt;/P&gt;&lt;P&gt;I am working on a directory monitor which will allow me to see what files are in a directory and report is one is missing or the like.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To test this, I created a scripted input to gather the contents of the directory and forward it to the indexer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;inputs.conf

###### Scripted Input to monitor directory files
[script://./bin/dircontents.sh]
disabled = 0
interval = 60
sourcetype = Script:dircontents.sh
index = filewatch&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;props.conf 

[Script:dircontents.sh]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)
MAX_EVENTS = 10000
TRUNCATE = 0
DATETIME_CONFIG = CURRENT&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;dircontents.sh

cd /u01/DeticaHome/UI/data/acquisition/waiting
ls | sort&lt;/LI-CODE&gt;&lt;P&gt;With those config files, I deploy the app without issue, but when the script runs I get the following;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal

07-23-2020 09:30:47.841 -0500 ERROR ExecProcessor - message from "/opt/splunkforwarder/etc/apps/_server_app_Detica-File-Processing-Mon/bin/dircontents.sh" /bin/sh: /opt/splunkforwarder/etc/apps/_server_app_Detica-File-Processing-Mon/bin/dircontents.sh: cannot execute&lt;/LI-CODE&gt;&lt;P&gt;It appears the permissions of the script are not correct.&amp;nbsp; I checked and the deploy script,&amp;nbsp;&amp;nbsp;dircontents.sh, permissions are 655 at deployment.&amp;nbsp; I changed the permissions to 755 manually and the script took off and started working, but this was a manual intervention which is not optimal.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;The Universal forwarder was installed and running as root.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To get this right, I need 755 permissions of the script fo the scripted input.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What have I missed?&amp;nbsp; Any insight would be great at this point.&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Rcp&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 15:41:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510687#M2771</guid>
      <dc:creator>raynold_peterso</dc:creator>
      <dc:date>2020-07-23T15:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input permissions and execution troubleshooting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510697#M2772</link>
      <description>If the .sh file has 755 permissions on the DS then that should be retained on the UFs.&lt;BR /&gt;Are you aware of the risks of running the UF as root?</description>
      <pubDate>Thu, 23 Jul 2020 17:12:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510697#M2772</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-23T17:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input permissions and execution troubleshooting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510710#M2773</link>
      <description>&lt;P&gt;The DS is a windows system and you can not set execute permissions on windows files.&amp;nbsp; Once it gets deployed the UF gives it a 655 permission set.&amp;nbsp; How do I get around that?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 18:12:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510710#M2773</guid>
      <dc:creator>raynold_peterso</dc:creator>
      <dc:date>2020-07-23T18:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input permissions and execution troubleshooting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510723#M2775</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;if I recall right you cannot use Windows DS for Linux/Unix (other than Windows) UF. Vice versa it’s ok.&lt;/P&gt;&lt;P&gt;You must switch your DS to Linux server to deploy all needed environments.&lt;/P&gt;&lt;P&gt;R. Ismo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 19:16:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510723#M2775</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-07-23T19:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input permissions and execution troubleshooting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510727#M2776</link>
      <description>Ah. This is critical information. Running a DS on Windows is a known problem because of this very reason. Can you stand up a Linux box to run the DS on?</description>
      <pubDate>Thu, 23 Jul 2020 19:23:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510727#M2776</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-23T19:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input permissions and execution troubleshooting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510728#M2777</link>
      <description>&lt;P&gt;So,&lt;/P&gt;&lt;P&gt;LinuxDS -&amp;gt; WindowsUF=OK&lt;BR /&gt;LinuxDS-&amp;gt;SolarisUF=OK&lt;BR /&gt;WindowsDS -&amp;gt; WindowsUF = OK&lt;BR /&gt;WindowsDS-&amp;gt; SolarisUF = BAD&lt;BR /&gt;WindowsDS-&amp;gt; LinuxUF = BAD.&lt;/P&gt;&lt;P&gt;Is this what I am to understand?&lt;/P&gt;&lt;P&gt;Well, that is rather unfortunate.&amp;nbsp; I'll start seeing what I can do to spin up a Linux system.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if I am off base.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 19:37:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510728#M2777</guid>
      <dc:creator>raynold_peterso</dc:creator>
      <dc:date>2020-07-23T19:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input permissions and execution troubleshooting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510729#M2778</link>
      <description>&lt;P&gt;That’s correct!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 19:38:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510729#M2778</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-07-23T19:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input permissions and execution troubleshooting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510731#M2779</link>
      <description>&lt;P&gt;I have kicked off the process and should have a AWS Linux system up soon.&amp;nbsp; I'll install splunk enterprise and configure it as my deployment server.&lt;/P&gt;&lt;P&gt;Thanks for all the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 19:56:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510731#M2779</guid>
      <dc:creator>raynold_peterso</dc:creator>
      <dc:date>2020-07-23T19:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input permissions and execution troubleshooting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510733#M2780</link>
      <description>Nice to hear that. As case is solved you should accept the solution so other can see it later on when they had same issue.</description>
      <pubDate>Thu, 23 Jul 2020 20:02:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/510733#M2780</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-07-23T20:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: Scripted Input permissions and execution troubleshooting</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/614740#M14000</link>
      <description>&lt;P&gt;What mechanism does this though? Linux would not create a a file with X set. The UF though might though add that permissions afterwards I'd imagine.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 12:06:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Scripted-Input-permissions-and-execution-troubleshooting/m-p/614740#M14000</guid>
      <dc:creator>shocko</dc:creator>
      <dc:date>2022-09-27T12:06:09Z</dc:date>
    </item>
  </channel>
</rss>

