<?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 Why is the script failing with parse interval error when pushed as App from Deployment server? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-script-failing-with-parse-interval-error-when-pushed/m-p/291708#M55577</link>
    <description>&lt;P&gt;hi Team,&lt;/P&gt;

&lt;P&gt;We are using a script to read files at regular intervals of time 900 seconds. It is working fine in our production environment where we have copied the script as an app manually. In our test environment when we pushed the App from Deployment server it is failing with Parse error.&lt;/P&gt;

&lt;P&gt;02-20-2018 07:15:30.434 +0100 ERROR ExecProcessor - Can't parse interval "900   #frequency to run the script, in seconds", ignoring script: "/app/splunkforwarder/etc/apps/TA_goep_esbsrv_foldermonitoring_CI/bin/filewatchError.sh"&lt;/P&gt;

&lt;P&gt;Am using the below App.&lt;/P&gt;

&lt;P&gt;TA_goep_esbsrv_foldermonitoring_CI App with bin and local folders.&lt;/P&gt;

&lt;P&gt;local has inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;inputs.conf
[script://$SPLUNK_HOME/etc/apps/TA_goep_esbsrv_foldermonitoring_CI/bin/filewatchError.sh]
host = SERVERNAME
index = esbsrvtest
interval = 900   #frequency to run the script, in seconds
sourcetype = foldermonitoringError
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;bin folder has files to monitor and sh script.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; cat filewatchError.sh
#!/bin/bash
file="/app/splunkforwarder/etc/apps/TA_goep_esbsrv_foldermonitoring_CI/bin/error-folders-CI.txt"
#Check the white space and stop before new line
while IFS= read -r var || [[ -n $var ]]
do
        #Check directory if exists
        if [ -d "$var" ]
        then
                #find the count of files on directory posted before 3 min
                number=$(find "$var" -type f | wc -l)

                if [ "$number" -gt 0 ]
                then
                        #echo "$(find "$var" -type f -printf '%TD %Tc filePath=%p timeModified=%TY-%Tm-%Td %TH:%TM\n')"
                        #echo "$(date) $(find "$var" -type f -printf 'filePath=%p timeModified=%TY-%Tm-%Td %TH:%TM\n')"
                        /usr/bin/find "$var" -type f -printf 'filePath=%p timeModified=%TY-%Tm-%Td %TH:%TM\n' | /usr/bin/xargs -I {} echo "$(date) {}"
                fi
        fi
done &amp;lt;"$file"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What can be wrong as it is working when it has been copied manually and it's not working when pushed from the Deployment server.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Sreedhar&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 18:05:57 GMT</pubDate>
    <dc:creator>mallempatisreed</dc:creator>
    <dc:date>2020-09-29T18:05:57Z</dc:date>
    <item>
      <title>Why is the script failing with parse interval error when pushed as App from Deployment server?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-script-failing-with-parse-interval-error-when-pushed/m-p/291708#M55577</link>
      <description>&lt;P&gt;hi Team,&lt;/P&gt;

&lt;P&gt;We are using a script to read files at regular intervals of time 900 seconds. It is working fine in our production environment where we have copied the script as an app manually. In our test environment when we pushed the App from Deployment server it is failing with Parse error.&lt;/P&gt;

&lt;P&gt;02-20-2018 07:15:30.434 +0100 ERROR ExecProcessor - Can't parse interval "900   #frequency to run the script, in seconds", ignoring script: "/app/splunkforwarder/etc/apps/TA_goep_esbsrv_foldermonitoring_CI/bin/filewatchError.sh"&lt;/P&gt;

&lt;P&gt;Am using the below App.&lt;/P&gt;

&lt;P&gt;TA_goep_esbsrv_foldermonitoring_CI App with bin and local folders.&lt;/P&gt;

&lt;P&gt;local has inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;inputs.conf
[script://$SPLUNK_HOME/etc/apps/TA_goep_esbsrv_foldermonitoring_CI/bin/filewatchError.sh]
host = SERVERNAME
index = esbsrvtest
interval = 900   #frequency to run the script, in seconds
sourcetype = foldermonitoringError
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;bin folder has files to monitor and sh script.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; cat filewatchError.sh
#!/bin/bash
file="/app/splunkforwarder/etc/apps/TA_goep_esbsrv_foldermonitoring_CI/bin/error-folders-CI.txt"
#Check the white space and stop before new line
while IFS= read -r var || [[ -n $var ]]
do
        #Check directory if exists
        if [ -d "$var" ]
        then
                #find the count of files on directory posted before 3 min
                number=$(find "$var" -type f | wc -l)

                if [ "$number" -gt 0 ]
                then
                        #echo "$(find "$var" -type f -printf '%TD %Tc filePath=%p timeModified=%TY-%Tm-%Td %TH:%TM\n')"
                        #echo "$(date) $(find "$var" -type f -printf 'filePath=%p timeModified=%TY-%Tm-%Td %TH:%TM\n')"
                        /usr/bin/find "$var" -type f -printf 'filePath=%p timeModified=%TY-%Tm-%Td %TH:%TM\n' | /usr/bin/xargs -I {} echo "$(date) {}"
                fi
        fi
done &amp;lt;"$file"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What can be wrong as it is working when it has been copied manually and it's not working when pushed from the Deployment server.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Sreedhar&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:05:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-script-failing-with-parse-interval-error-when-pushed/m-p/291708#M55577</guid>
      <dc:creator>mallempatisreed</dc:creator>
      <dc:date>2020-09-29T18:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the script failing with parse interval error when pushed as App from Deployment server?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-script-failing-with-parse-interval-error-when-pushed/m-p/291709#M55578</link>
      <description>&lt;P&gt;End of line comments are not allowed in .conf files.&lt;BR /&gt;
see &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Howtoeditaconfigurationfile#Insert_a_comment"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Admin/Howtoeditaconfigurationfile#Insert_a_comment&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;instead of&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; interval = 900   #frequency to run the script, in seconds
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;put your comment on the next line &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; interval = 900   
#frequency to run the script, in seconds
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Feb 2018 01:04:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-the-script-failing-with-parse-interval-error-when-pushed/m-p/291709#M55578</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2018-02-22T01:04:40Z</dc:date>
    </item>
  </channel>
</rss>

