Dashboards & Visualizations

ダッシュボードでパネルを反復させて表示させる方法

RyoTakebayashi
Explorer

ダッシュボードのパネルをfor文やwhile文のような反復処理の形を使って表現できますでしょうか?

同じTimechartのグラフをトークンで値を変える形で複数作成したいと思っております。
コピーすれば実現できますが、サーチ文を編集する際等に全てのパネル内のサーチ文を編集する必要が出てきますので、できれば反復処理で実現できればと考えております。

<背景>
ネットワークスイッチのポートごとの利用率をTimechartでダッシュボードにしようと考えております。
また、Machine Learningも利用しようと思ってます。
1つのTimechartには複数のデータを表示することができますが、Machine Learning (forecast)による予測値は1つのデータしか出せないようです。

そこで、ネットワークスイッチのポートの数だけ、Timechart+Machine Learningのグラフを作ろうと思ってます。
しかしスイッチのポートも20だったり40だったりと数が多いので、パネルを複製してコピーするのは、後でサーチ文を編集することを考慮に入れると効率的ではないと感じております。

0 Karma
1 Solution

HiroshiSatoh
Champion

反復処理ではないですが、ベースとなるサーチ文を共有して各パネルのサーチ文には
差分のみを記述する方法があります。

例.ベースとなるサーチ文(baseSearch)でポート毎の集計まで行い、各パネルには_timeとポートを設定する。

<dashboard>
  <search id="baseSearch">
    <query>*|timechart span=1d count by port</query>
  </search>
  <label>test</label>
  <row>
    <panel>
      <chart>
        <search base="baseSearch">
          <query>fields _time,8089</query>
        </search>
        <option ・・・・・・
      </chart>
    </panel>
  </row>
  <row>
    <panel>
      <chart>
        <search base="baseSearch">
          <query>fields _time,8000</query>
        </search>
        <option ・・・・・・
      </chart>
    </panel>
  </row>
</dashboard>

View solution in original post

0 Karma

RyoTakebayashi
Explorer

ご回答ありがとうございます。
baseSearchという方法があるのですね。大変参考になりました。

0 Karma

HiroshiSatoh
Champion

反復処理ではないですが、ベースとなるサーチ文を共有して各パネルのサーチ文には
差分のみを記述する方法があります。

例.ベースとなるサーチ文(baseSearch)でポート毎の集計まで行い、各パネルには_timeとポートを設定する。

<dashboard>
  <search id="baseSearch">
    <query>*|timechart span=1d count by port</query>
  </search>
  <label>test</label>
  <row>
    <panel>
      <chart>
        <search base="baseSearch">
          <query>fields _time,8089</query>
        </search>
        <option ・・・・・・
      </chart>
    </panel>
  </row>
  <row>
    <panel>
      <chart>
        <search base="baseSearch">
          <query>fields _time,8000</query>
        </search>
        <option ・・・・・・
      </chart>
    </panel>
  </row>
</dashboard>
0 Karma

melonman
Motivator
0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

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 ...