Dashboards & Visualizations

Using collect command with post search in dashboard.

dillencehsu
Path Finder

I using collect command with post search in dashboard.
I want to control collect data to summary index or not in dashboard, I created this dashboard.

Panel 1: 
search id="main"
{ main search and table all fields that need. }

Panel 2:
input field
token=collect_index
single selection:
       ・no summary : 
       ・to summary : | collect index=summary_index_name
search base="main"
{ | table fields that need
   |  where user=$drilldown_user$ (from Panel 1 with drilldown token) 
   | eval .... some process
  $collect_index$
}

But, the summary_index_name will have duplicates collected events.

And I tried create 2 dedicate search panel in the dashboard, the collected events did not duplicates.

Any suggestion ?

 

Thanks.

---------------------------------------------------------------------------------------------------------------------------

こんにちは

ダッシュボードの中に、サーチの結果をサマリーインデックスに書き込むかをコントロールしたいので、このダッシュボードを作りました。このダッシュボードの中に2つサーチパネルがあります。

パネル1:
search id="main"
{ メインサーチで必要のフィルドを出します。}

パネル2:
input field
token=collect_index
シングル選択し:
       ・no summary : 
       ・to summray : | collect index=サマリーインデックス名

search base="main"
{ | table 必要なフィルド
   |  where user=$drilldown_user$ (パネル1からのトクンバリュー) 
   | eval などの処理
   $collect_index$
}

ただ、上記の post search で経由して、collect したデータは重複になってます。
index=_audit で確認すると、確かに1秒で同じのサーチ(run_collect)が複数回で実行していた。

そして、
別々のパネルで分けて独立のサーチを作ったことがありますが、独立のサーチは上記の問題発生しません。
index=_audit でも確認した、run_collect ただ1回しかないです。

アドバイスをいただければ助かります。
お手数をおかけしますが、どうぞよろしくお願いいたします。

 
 
 
 
 
Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Add something to your query in panel 2 that filters out the duplicates so that only the additions are displayed or add this filter to the selection before the collect command so that only the additions are added to the summary index

0 Karma

dillencehsu
Path Finder

Thanks for your replay.

But, in the panel 2 just have 1 event.
After Collected to summary index, the summary index will have duplicates events.

And I also checked the index=_audit, "run_collect" has been run many times in the same second.
I don't know what happened.

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...