Alerting

アラートのメール送信先アドレスについて

haruka_saito
Explorer

アラートの設定で、閾値を超えたデータに対してメールを送信しようと考えています。
データによってメールの送信先を変えることは可能でしょうか?

具体的には、経過日数が3日を超えたデータに対してメールを送りたいです。

**チーム名**  **経過日数**
チームA    1day
チームB    5days
チームC    3days

こちらのデータですと、
チームBのデータをチームBのメールアドレスに送り、
チームCのデータをチームCのメールアドレスに送るイメージです。

アラートを複数作成すればできると思うのですが、アラート1つで可能かお聞きしたいです。
よろしくお願いいたします。

0 Karma

melonman
Motivator

まず、チーム名と対応するemailアドレスを準備し、Splunkから参照できるように設定します。(参考:ルックアップ設定

例)email_address 用のCSV

team,email
チームA,A@example.com
チームB,B@example.com
チームC,C@example.com
チームD,D@example.com

3日以上立っているチームをwhereでフィルターして、
lookupの機能を利用して各チームに対するemailアドレスを結果に付加します。

...結果のサーチ | where data_age>=3 |  lookup email_address team OUTPUT email

例えば、以下のような形にします。

team      data_age   email       
チームB    5days      B@example.com
チームC    3days      C@example.com

上のような結果をアラート対象にして、それぞれをemailフィールドに指定されているアドレスに結果を送信するには、アラートの設定で"アラートモード"を結果あたり一回(参考:Per-Result Alert)に指定して、メールの宛先に $result.email$ という形で、emailフィールドを指定していただければいけるとおもいます。(参考:alert設定時のトークンについて

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...