Linux(Ubuntu/CentOS) 安装 splunkforwarder 步骤:
splunkforwarder 是 splunk 的客户端 log 转发工具:
下载网址 (下载 tar 包):
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 服务器端 -- 设置 -- 转发器管理 -- 能看到客户端已连接
来源: http://www.bubuko.com/infodetail-3084105.html