1.測試環境選擇
splunk Enterprise:7.2.5
python :2.7.5
2.運作Python代碼時,可能會出現如下錯誤:
ImportError: libssl.so.1.0.0: cannot open shared object file: No such file or directory
解決辦法:
在 ~/.bashrc檔案裡面添加如下配置:
export LD_LIBRARY_PATH=/opt/splunk/lib/:$LD_LIBRARY_PATH
使配置生效:
source ~/.bashrc
參考:https://answers.splunk.com/answers/432283/why-am-i-getting-error-libsslso100-cannot-open-sha.html
3.安裝splunk ,環境變量配置
打開~/.bash_profile
添加以下配置
export SPLUNK_HOME=/opt/splunk
export PATH=$SPLUNK_HOME/bin:$PATH
最後 source ~/.bash_profile
4.splunk設定開機自啟動
splunk enable boot-start