Installation Script for Splunk
#!/bin/bash
echo "Splunk Installation"
yum install splunk<version> -y --nogpgcheck
usermod -G <group that splunk is going to be join> splunk
/opt/splunkforwarder/bin/splunk enable boot-start -user splunk --accept-license
su splunk -c "/opt/splunkforwarder/bin/splunk add forward-server splunk.example.com:9997"
su splunk -c "/opt/splunkforwarder/bin/splunk edit user admin -password password -auth admin:password"
su splunk -c "/opt/splunkforwarder/bin/splunk start"
for dir in $(find /var/point -mindepth 1 -maxdepth 1 -type d)
do
su splunk -c "/opt/splunkforwarder/bin/splunk add monitor $dir/logs -index $env -sourcetype $(basename $dir)"
done
chkconfig splunk on
echo "Installation complete"
echo "Splunk Installation"
yum install splunk<version> -y --nogpgcheck
usermod -G <group that splunk is going to be join> splunk
/opt/splunkforwarder/bin/splunk enable boot-start -user splunk --accept-license
su splunk -c "/opt/splunkforwarder/bin/splunk add forward-server splunk.example.com:9997"
su splunk -c "/opt/splunkforwarder/bin/splunk edit user admin -password password -auth admin:password"
su splunk -c "/opt/splunkforwarder/bin/splunk start"
for dir in $(find /var/point -mindepth 1 -maxdepth 1 -type d)
do
su splunk -c "/opt/splunkforwarder/bin/splunk add monitor $dir/logs -index $env -sourcetype $(basename $dir)"
done
chkconfig splunk on
echo "Installation complete"
Comments
Post a Comment