0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

splunkinstallsplunkinstall

Posted at
Splunkインストールメモ

◎インストール準備

・OSインストール
RHEL8系かRHEL9系のOSを入れる。
CentOS Stream 8でも9でも今の所特に問題無し。
Splunkを動かすだけならミニマルインストールで問題無いはず。
ただし、RHEL9系、例えば、CentOS Stream 9に入れて、OS起動時にSplunkも自動起動する設定をしたい場合は、/etc/init.dでの自動起動を可能にする為に、initscriptsをインストールしておく必要有り。
yum install initscripts

以下のようにすればinitscriptsは不要?
splunk enable boot-start -systemd-managed 1

・SELINUXを止める
動いていても特に問題は無さそうだが、何か追加でやろうとした時に面倒が無いように止めておく。
/etc/selinux/configの
SELINUX=enforcing
を
SELINUX=disabled
に変更。

・Firewalldのポート開け
SplunkへのWebアクセスのデフォルトポート8000のfiewall設定を開放。
firewall-cmd --add-port=8000/tcp --zone=public --permanent

◎Splunkインストール

・RPMファイルのダウンロード。
現時点での最新版は以下のファイル。
splunk-9.0.4.1-419ad9369127-linux-2.6-x86_64.rpm

・OS上へのコピー
SplunkをインストールするOS上にRPMファイルをSCP等でコピー。
置き場所は、/var/tmpあたりでよい。

・rpmコマンドでインストール
RPMファイルを置いたディレクトリで以下のコマンドを実行。
認証等の警告が出るかもしれないがインストールには特に問題無し。
rpm -i splunk-9.0.4.1-419ad9369127-linux-2.6-x86_64.rpm

・初期設定
まず
chown -R splunk.splunk /opt/splunk
する必要ありかも

デフォルトのインストールでは、/opt/splunkにインストールされるので、/opt/splunk/binに移動して以下のコマンドを実行。
ユーザ名とパスワードの入力を求められるので、Splunkへログインする際のユーザ名とパスワードを入力する。
./splunk start --accept-license

・自動起動設定
OS起動時にSplunkを自動起動する設定にするには、/opt/splunk/binで以下のコマンドを実行。
RHEL9系の場合は、インストール準備のOSインストールで書いたように、initscriptsがインストールされていないとエラーになるので要注意。
./splunk enable boot-start

RHEL9系では以下のオプション付きで実行
./splunk enable boot-start -systemd-managed 1

・タイムゾーン
/opt/splunk/etc/system/local
に
props.conf
を作成して
[default]
TZ = Asia/Tokyo
を設定

◎Splunkへログイン

・Webブラウザでログイン
SplunkをインストールしたOSのネットワークアドレスが、例えば、a.b.c.dならば、以下のURLをWebブラウザで開くとログイン画面が出るので、インストール時の初回起動時に設定したユーザ名とパスワードでログインする。
http://a.b.c.d:8000
Splunk Streamインストール関係メモ

・Splunk Stream 8.0.0のドキュメントURL
https://docs.splunk.com/Documentation/StreamApp/8.0.0/DeployStreamApp/InstallSplunkAppforStreaminasingleinstance

1: Splunk Add-on for Stream Wire Data (Splunk_TA_stream_wire_data)
2: Splunk App for Stream (splunk_app_stream)
3: Splunk Add-on for Stream Forwarders (Splunk_TA_stream)
の順でインストールするのが推奨

・Splunk Streamの最初の設定でエラーが出る場合
/opt/splunk/etc/system/local
に
inputs.conf
を作って、
[default]
host = [Splunkを動かしているホスト名]
という設定を入れる。
うちの環境の場合は、
[root@rhel8 local]# cat inputs.conf
[default]
host = rhel8.5

/opt/splunk/etc/apps/Splunk_TA_stream/local
の設定ファイル内容
[root@rhel8 local]# cat inputs.conf
[streamfwd://streamfwd]
splunk_stream_app_location = http://localhost:8000/en-us/custom/splunk_app_stream/
stream_forwarder_id =
disabled = 0
index = netflow

[root@rhel8 local]# cat streamfwd.conf
[streamfwd]
logConfig = streamfwdlog.conf
port = 8889
ipAddr = 127.0.0.1

netflowReceiver.0.ip = 192.168.0.10
netflowReceiver.0.port = 9995
netflowReceiver.0.decoder = netflow

・FW設定

[root@rhel8 local]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp0s3
  sources:
  services: cockpit dhcpv6-client ssh
  ports: 8000/tcp 9995/udp 9997/tcp
  protocols:
  forward: no
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

firewall-cmd --add-port=8000/tcp --add-port=9997/tcp --add-port=9995/udp --permanent

・NetFlow設定
bytes_in
dest_ip
dest_port
exporter_ip
exporter_time
flow_dir
input_snmpidx
netflow_version
packets_in
protoid
seqnumber
src_ip
src_port
tcp_flags
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?