Yayy! I got it working
The reason was (and correct me if I am wrong) - As per the instructions for packaging, I had deleted all local files under /local and /metadata . This leads to incomplete information in packaged your_package_name.spl post installation in new environment. Do not delete these files.
When we add a data input from GUI, parameters like path of source and sourcetype are added in /local/inputs.conf. If packaged .spl does not have these local files, it is unable to get the right paths and sourcetypes!
So, to package an app all we need to do is:
$SPLUNK_DEV/etc/apps/framework# ./splunkdj package "your_package_name"
[ This will create a your_package_name.spl in the same directory ]
$SPLUNK_TEST/etc/apps/framework# ./splunkdj install "path/your_package_name.spl"
[ This will extract it in /etc/apps/your_package_name/ ]
Verify all files have been extracted properly (including those under /local) and hopefully you are back on track!
... View more