Installing Splunk Universal Forwarder?

Installing Splunk Universal Forwarder?
  • Navigate to https://www.splunk.com/en_us/download/universal-forwarder.html
  • Login to splunk.com if not done already.
  • Choose  the OS for which you want to download the forwarder.
    • In my case I will be using amazon linux, so I will choose a .rpm package.
  • Download and save on the machine from which you want to send the logs to your Splunk enterprise installation.
  • In my case its splunkforwarder-7.2.4-8a94541dcfac-linux-2.6-x86_64.rpm
[splunk@ip tmp]$ sudo rpm -ivh splunkforwarder-7.2.4-8a94541dcfac-linux-2.6-x86_64.rpm
[sudo] password for splunk:
warning: splunkforwarder-7.2.4-8a94541dcfac-linux-2.6-x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID b3cd4420: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:splunkforwarder-7.2.4-8a94541dcfa################################# [100%]
complete
[splunk@ip tmp]$
  • Once installed you will find your installation here "/opt/splunkforwarder"
  • Start your forwarder.
  • Make sure you configure to start your splunk daemon on startup so that you need not to start the service every now and then.
[splunk@ip bin]$ ./splunk start
[splunk@ip bin]$ sudo ./splunk enable boot-start
[sudo] password for splunk:
Init script installed at /etc/systemd/system/.
Init script is configured to run at boot.
[splunk@ip bin]$
  • To see what all forward-servers are configured, use "./splunk list forward-server"
    • As of now, nothing is configured.
[splunk@ip bin]$ ./splunk list forward-server
Splunk username: admin
Password:
Active forwards:
        None
Configured but inactive forwards:
        None
  • Lets configure one, to add a forward-server, use "./splunk add forward-server HOST_INDEXER:9997"
[splunk@ip bin]$ ./splunk add forward-server HOST_INDEXER:9997
Added forwarding to: HOST_INDEXER:9997.
[splunk@ip bin]$ ./splunk list forward-server
Active forwards:
        None
Configured but inactive forwards:
        HOST_INDEXER:9997
  • Now, lets add something to monitor, i.e. what do you want to send to the indexer?
    • Below are some sample parameters:
      • Log location
      • Index, on which index you want to save the events.
      • Sourcetype,
[splunk@ip bin]$ ./splunk add monitor /var/log/messages -index idx_messages -sourcetype linux_logs
Added monitor of '/var/log/audit'.
  • Once you have added the monitor, you will see that the entry moved from inactive forwards to active one.
[splunk@ip bin]$ ./splunk list forward-server 
Active forwards:
        HOST_INDEXER:9997
Configured but inactive forwards:
        None
[splunk@ip bin]$


  • If everything went well then you can see the data from your remote machine on the Splunk indexer.
    • Current status of messages log file:
      • -rw-------  1 splunk splunk          164418 Mar 10 13:52 messages
      • If you will see the screen dump given below it matches with the latest event.

Comments

Popular posts from this blog

#3 Splunk sub(Commands) [eval, round, trim, stats, ceil, exact, floor, tostring]

#6 Splunk sub(Commands) [fields, rename, replace, table, transaction]

#1 Splunk sub(Commands) [top, rare, fields, table, rename, sort]