2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Splunk]Splunk Universal Forwarderの構築

Posted at

[Splunk]Splunk Universal Forwarderの構築

目的・背景

SplunkはSerchHead、Indexer、Forwarderで構成されます。
SerchHeadとIndexerはSplunk Enterpriseをインストールし、設定を変更することで役割が変わります。
ForwarderはHeavy ForwarderとUniversal Forwarderがありますが、Heavy ForwarderはSearchHead、Indexer同様に、Splunk Enterpriseの設定変更でHeavy Forwarderとして動作しますが、Universal Forwarderは別途インストーラが用意されています。

今回はSplunk Universal Forwaderの環境を構築してみました。

目標

Splunk Universal Forwaderを構築。
別サーバのSplunk Enterpriseへチュートリアルデータを送信する。

参考サイト

Splunk Universal Forwarderでデータ転送してみる

手順

  • インストール
$ sudo apt update
$ cd /usr/local/src
$ sudo wget -O splunkforwarder-8.0.6-152fb4b2bb96-Linux-x86_64.tgz 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=8.0.6&product=universalforwarder&filename=splunkforwarder-8.0.6-152fb4b2bb96-Linux-x86_64.tgz&wget=true'
$ sudo tar zxvf splunkforwarder-8.0.6-152fb4b2bb96-Linux-x86_64.tgz -C /usr/local/
$ sudo chown -R ubuntu:ubuntu /usr/local/splunkforwarder/
  • 起動
$ cd /usr/local/splunkforwarder/bin
$ ./splunk start --accept-license --answer-yes

This appears to be your first time running this version of Splunk.

Splunk software must create an administrator account during startup. Otherwise, you cannot log in.
Create credentials for the administrator account.
Characters do not appear on the screen when you type in credentials.

Please enter an administrator username: admin
Password must contain at least:
   * 8 total printable ASCII character(s).
Please enter a new password:
Please confirm new password:
    :
	All installed files intact.
	Done
All preliminary checks passed.

Starting splunk server daemon (splunkd)...
Done
  • 設定
$ cd /usr/local/splunkforwarder/etc/apps/
$ mkdir -p splk_all_forwarder_base/local
$ cd splk_all_forwarder_base/local/
  • 転送先の設定(app.conf)
$ vi app.conf

[install]
state = enabled

[package]
check_for_updates = false

[ui]
is_visible = false
is_manageable = fals
  • 転送速度の制限解除(limits.conf)
$ vi limits.conf

[thruput]
maxKBps = 0
  • 転送先indexerの設定(outputs.conf)
$ vi outputs.conf

[tcpout]
defaultGroup = primary_indexers
forceTimebasedAutoLB = true

[tcpout:primary_indexers]
server = 13.230.12.171:9997

serverに指定するIPアドレスはEC2インスタンスtのIPv4パブリックIPを指定

  • 設定反映(Universal Forwarderの再起動)
$ cd /usr/local/splunkforwarder/bin/
$ ./splunk restart
Stopping splunkd...
Shutting down.  Please wait, as this may take a few minutes.
    :
All preliminary checks passed.

Starting splunk server daemon (splunkd)...
Done
  • 動作確認(チュートリアルデータ)
$ sudo apt install -y unzip
$ cd /usr/local/src
$ sudo wget http://docs.splunk.com/images/Tutorial/tutorialdata.zip
$ sudo unzip tutorialdata.zip -d tutorialdata

$ cd /usr/local/splunkforwarder/bin
$ ./splunk add oneshot /usr/local/src/tutorialdata/www1/access.log -index main -sourcetype access_combined_wcookies

Splunk username: admin
Password:
Oneshot '/usr/local/src/tutorialdata/www1/access.log' added

※(課題)oneshotコマンド自体はエラーになりませんでしたが、Splunk Enterpriseへは届きませんでした。

おわりに

インストール、起動確認はできましたがOneshotでログ送信ができませんでした。
Oneshot以外にも監視タイプで送信することもできるようです。
引き続き検証は続ける予定です。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?