I need to return the file names only, from a particular directory as soon as the file is getting created. i tried using "exec" input plugin for this. For achieveing this i wrote a shell script as below :
(cd /home/development/DEMO/ && ls *.stdout) > /tmp/watchfile ; while true; do (cd /home/development/DEMO/ && ls *.stdout) > /tmp/watchfile2 ; diff -q /tmp/watchfile /tmp/watchfile2 > /dev/null ; if [ $? -ne 0 ] ; then echo "File list changed" ; echo diff /tmp/watchfile /tmp/watchfile2; fi ; cp /tmp/watchfile2 /tmp/watchfile ; done
Note : the second echo is under accent graves but not showing here properly !
The script is working fine through terminal, but when i try to put this in exec input plugin its throwing error.
Please suggest how can i achieve this or is their some other plugin i can modifiy & use like the "file" input plugin. Thanks in advance
but instead of a single command for exec input plugin i have given an entire script in one line with "; ".
I thought if a single command is working why not can i give a whole script. But its not working as u can see here :
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.