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!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...