I have a scripted input, top20.sh, calling another script - top.sh.
interval = 60
sourcetype = top
source = top
index = linux
disabled = 0
./bin/top.sh | head -n 20
I am not getting data. Running top.sh works fine. Am I assuming the correct relative path? Any other reasons why this is not returning data?
The following worked on top20.sh. Not 100% sure, but I believe the modification gets the path of the calling script:
`dirname $0`/top.sh | head -n 20
View solution in original post
No, the script will actually be run with the filesystem root (/) as its working directory, so you'd have to provide the full path to your other script in order to execute it successfully.