Splunk Enterprise

SplunkのDEBUG設定について

cwl
Contributor

Splunk関係の問題を調査するために、Splunkの内部ログにDEBUG情報を出力したいですが、具体的な手順を教えて頂けますか。

0 Karma
1 Solution

cwl
Contributor

以下の方法でDEBUG情報を出力することができます。

1. 再起動が必要ない方法
Splunkを再起動することなく、以下の方法でDEBUG情報を出力することができます。
但し、何かの理由でSplunkを停止した場合、DEBUG設定がリセットされますので、注意してください。
[ CLIの方法 ]
「splunk set log-level -level DEBUG」コマンドを実行することで動的にDEBUG情報を出力することができます。
例:

splunk set log-level TailingProcessor -level DEBUG

[ UIの方法 ]
Splunk UIにログインし、「設定」=>「サーバー設定」=>「サーバーログ」を選択し、右上の検索フィルドからDEBUG対象のログチャネルを検索し、検索結果からDEBUG対象のログチャネルを選択し、「ログの出力レベル」で「デバッグ」を選択し、「保存」ボタンをクリックすることで動的にDEBUG情報を出力することができます。
alt text
alt text

2. 再起動が必要な方法
DEBUG設定を反映するためにSplunkを再起動する必要がありますが、Splunkを停止してもDEBUG設定を保持できます。
[ log.cfgの編集の方法 ]
「SPLUNK_HOME/etc/log.cfg」内に記載されているログチャネルを既存のログレベルからDEBUGに変更することにより、Splunkの再起動後にDEBUG情報が出力できるようになります。
また、対象のログチャネルが記載されていない場合、「category.=DEBUG」で追加することができます。
そして、DEBUG情報を出力できるようになりますと、splunkd.log等が早くロールすることになりますので、「appender.A1.maxFileSize」および「appender.A1.maxBackupIndex」を合わせて増やすことをお勧めします。

[splunkd]
rootCategory=WARN,A1
# MetricStore
category.CatalogSearchJob=INFO
category.MetricStoreCatalogBaseHandler=INFO
...
category.TailingProcessor=DEBUG
...
appender.A1=RollingFileAppender
appender.A1.fileName=${SPLUNK_HOME}/var/log/splunk/splunkd.log
appender.A1.maxFileSize=50000000 # default: 25MB (specified in bytes).
appender.A1.maxBackupIndex=10
appender.A1.layout=PatternLayout

詳細について以下のマニュアルを参照してください。
https://docs.splunk.com/Documentation/Splunk/7.2.0/Troubleshooting/Enabledebuglogging

View solution in original post

0 Karma

cwl
Contributor

以下の方法でDEBUG情報を出力することができます。

1. 再起動が必要ない方法
Splunkを再起動することなく、以下の方法でDEBUG情報を出力することができます。
但し、何かの理由でSplunkを停止した場合、DEBUG設定がリセットされますので、注意してください。
[ CLIの方法 ]
「splunk set log-level -level DEBUG」コマンドを実行することで動的にDEBUG情報を出力することができます。
例:

splunk set log-level TailingProcessor -level DEBUG

[ UIの方法 ]
Splunk UIにログインし、「設定」=>「サーバー設定」=>「サーバーログ」を選択し、右上の検索フィルドからDEBUG対象のログチャネルを検索し、検索結果からDEBUG対象のログチャネルを選択し、「ログの出力レベル」で「デバッグ」を選択し、「保存」ボタンをクリックすることで動的にDEBUG情報を出力することができます。
alt text
alt text

2. 再起動が必要な方法
DEBUG設定を反映するためにSplunkを再起動する必要がありますが、Splunkを停止してもDEBUG設定を保持できます。
[ log.cfgの編集の方法 ]
「SPLUNK_HOME/etc/log.cfg」内に記載されているログチャネルを既存のログレベルからDEBUGに変更することにより、Splunkの再起動後にDEBUG情報が出力できるようになります。
また、対象のログチャネルが記載されていない場合、「category.=DEBUG」で追加することができます。
そして、DEBUG情報を出力できるようになりますと、splunkd.log等が早くロールすることになりますので、「appender.A1.maxFileSize」および「appender.A1.maxBackupIndex」を合わせて増やすことをお勧めします。

[splunkd]
rootCategory=WARN,A1
# MetricStore
category.CatalogSearchJob=INFO
category.MetricStoreCatalogBaseHandler=INFO
...
category.TailingProcessor=DEBUG
...
appender.A1=RollingFileAppender
appender.A1.fileName=${SPLUNK_HOME}/var/log/splunk/splunkd.log
appender.A1.maxFileSize=50000000 # default: 25MB (specified in bytes).
appender.A1.maxBackupIndex=10
appender.A1.layout=PatternLayout

詳細について以下のマニュアルを参照してください。
https://docs.splunk.com/Documentation/Splunk/7.2.0/Troubleshooting/Enabledebuglogging

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...