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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...