4
4

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: 内部ログを確認する

Posted at

しばしば必要となるのでメモ。

実施環境: Splunk Free 8.2.2

Splunk 自体の内部ログは、基本的には _internal という名前のインデックスに保管されています。

[Splunk 内部ログ一覧] (https://docs.splunk.com/Documentation/Splunk/8.2.2/Troubleshooting/WhatSplunklogsaboutitself)

Splunk
index="_internal"
| stats count BY sourcetype, source

スクリーンショット 2021-10-17 14.29.26.png

_internal ログには複数のログが格納されていますが、よく使用されるログは次のとおりです。

メインログ

ソースタイプ名:splunkd
ログファイル名:splunkd.log

Splunk のメインログです。
大抵のログはここに出力されるため、何か問題が発生した場合はまずここを確認します。

Splunk
index="_internal" sourcetype="splunkd" source="*/splunkd.log" log_level="ERROR"
| table _time, event_message

スクリーンショット 2021-10-17 15.07.42.png

メトリクスログ

ソースタイプ名:splunkd
ログファイル名:metrics.log

スループット等、 Splunk のパフォーマンスに関連する情報が出力されるログです。
Splunk の性能分析に使用できます。

Splunk
index="_internal" sourcetype="splunkd" source="*/metrics.log" group="per_index_thruput"
| stats avg(kbps) BY series

スクリーンショット 2021-10-17 15.01.30.png

ライセンス使用量ログ

ソースタイプ名:splunkd
ログファイル名:license_usage.log

ログデータの取り込み量が出力されるログです。
日々のログ流用を確認するのに使用できます。
Splunk のライセンス料は1日のログの取り込み量が基準となるため、日々のログ流用は重要な情報です。

Splunk
index="_internal" sourcetype="splunkd" source="*/license_usage.log"
| where isnotnull(idx)
| eval index_sourcetype = idx + ":" + st
| timechart span=1d sum(b) BY index_sourcetype

スクリーンショット 2021-10-17 14.44.54.png

スケジュールログ

ソースタイプ名:scheduler
ログファイル名:scheduler.log

スケジュールしたジョブの実行履歴が出力されるログです。
定期的に動作させているジョブについて、開始/終了時刻や成否を確認するのに使用できます。
直近のジョブであれば他にも確認方法はありますが、古いジョブの実績を知る場合は本ログを見る必要があります。

Splunk
index="_internal" sourcetype="scheduler" source="*/scheduler.log"
| where isnotnull(savedsearch_name)
| table _time, savedsearch_name, status

スクリーンショット 2021-10-17 15.11.13.png

監査ログ

インデックス名:_audit

ログイン履歴等、監査に必要な情報が出力されるログです。
本ログは例外的に、 _internal とは別の _audit という名前のインデックスに格納されています。
個人レベルではあまり必要ないかもしれませんが、企業その他の団体で使用されるサーバの場合はセキュリティ上非常に重要なログです。

Splunk
index="_audit" action="login attempt"
| table _time, clientip, user, info

スクリーンショット 2021-10-17 15.16.26.png

4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?