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"

Comments

Popular posts from this blog

How to clean all the foreman task and locked task

CentOS 7 Server Hardening Guide

How to restrict users to send only mail to the local domain in Zimbra