Linux(Ubuntu/CentOS)安装splunkforwarder步骤:
splunkforwarder是splunk的客户端log转发工具:
下载网址(下载tar包):
https://www.splunk.com/en_us/download/universal-forwarder.html
splunk服务器端要开启接收端口(设置——转发和接收——配置接收——新增——9997)
客户端:
安装:
tar zxfv splunkforwarder-7.3.0-657388c7a488-Linux-x86_64.tgz -C /opt/
启动splunkforwarder:
/opt/splunkforwarder/bin/splunk enable boot-start
回车,100%后输入y
帐号名:splunk (启动时需要有个管理帐号)
密码:xxxxx
service splunk start
/opt/splunkforwarder/bin/splunk set deploy-poll ip:8089
输入上面设置的帐号密码
/opt/splunkforwarder/bin/splunk add forward-server ip:9997 (ip为splunk服务器端ip)
查看接收服务器:
/opt/splunkforwarder/bin/splunk list forward-server
添加收集项:
/opt/splunkforwarder/bin/splunk add monitor /var/log/mysql/error.log
/opt/splunkforwarder/bin/splunk add monitor /var/log/httpd/error_log
也可以直接修改下面文件:
/opt/splunkforwarder/etc/apps/search/local/inputs.conf
重启服务:
service splunk restart
到splunk服务器端——设置——转发器管理——能看到客户端已连接