It seems to be happening due to not unsetting proxy values as "akhtet" said.
I used a below generic bash script on my mac and it fixed the problem.
==splunk.sh==
#!/bin/bash
if [ "$1" = "start" ] ; then
export SPLUNK_HOME=/Applications/Splunk/
source $SPLUNK_HOME/bin/setSplunkEnv
export PATH=$SPLUNK_HOME/bin:$PATH
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
fi
/Applications/Splunk/bin/splunk $1
usage :
./splunk.sh start
./splunk.sh stop
./splunk.sh status
./splunk.sh
... View more