Splunkが発行するアラートには、発火の要因となったサーチ結果へのリンクを含めることができる。
このURLのホスト名はデフォルトではSearchheadのサーバー名となるが、SplunkのSearchheadがバランサ配下にある等、サーバー名とURLが異なる場合は、リンク先を変更したくなる。
Email通知などの組み込み通知機構に関しては、alert_action.conf
のhostname
で変更できる:
が、Slack通知は追加Appなので<splunk_home>/etc/system/local/...
での設定を認識しない。
Slack通知のhostnameを変更するにはAppの設定ファイル<splunk_home>/etc/apps/slack_alerts/local/alert_actions.conf
を変更する。
Ansible的に書くとこのようになる:
- become_user: splunk
ini_file:
path: /opt/splunk/etc/apps/slack_alerts/local/alert_actions.conf
section: null
option: hostname
value: https://example.com:443
notify: Restart splunk