0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Splunk Dashboard Studio【実務向け応用編】

Posted at

Dashboard Studio【実務向け応用編】

現場で即使える!実践パターン集


📋 目次

1. 実務で必要な機能一覧
2. サーバー監視ダッシュボード(完全版)
3. Webアクセス監視ダッシュボード
4. エラー監視ダッシュボード
5. 複数パネルの連携
6. ドリルダウン機能
7. フィルター・タイムピッカー
8. アラート設定
9. 共有・権限管理
10. パフォーマンス最適化

📊 パート1: 実務で必要な機能一覧【優先度順】

機能 優先度 難易度 用途 学習時間
基準線の動的変更 🔥🔥🔥 最重要 ⭐⭐ 異常検知 30分
複数パネル配置 🔥🔥🔥 最重要 全体把握 15分
タイムピッカー 🔥🔥 重要 期間指定 10分
フィルター 🔥🔥 重要 ⭐⭐ データ絞り込み 20分
ドリルダウン 🔥 やや重要 ⭐⭐⭐ 詳細確認 30分
自動更新 🔥🔥 重要 リアルタイム監視 5分
アラート連携 🔥 やや重要 ⭐⭐ 異常通知 20分
共有設定 🔥🔥 重要 チーム共有 10分

🖥️ パート2: サーバー監視ダッシュボード【完全版】

完成イメージ

┌─────────────────────────────────────────────────────────────┐
│  🖥️ サーバー監視ダッシュボード               [🔄更新: 30秒]  │
├─────────────────────────────────────────────────────────────┤
│  📅 [直近24時間 ▼]  🖥️ [全サーバー ▼]  🔍 [フィルター]     │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐      │
│  │ CPU      │ │ メモリ   │ │ ディスク │ │ エラー数 │      │
│  │ 🔢 75%   │ │ 🔢 82%   │ │ 🔢 68%   │ │ 🔢 12件  │      │
│  │ ⚠️ 警告  │ │ 🔴 危険  │ │ ✅ 正常  │ │ ⚠️ 注意  │      │
│  └──────────┘ └──────────┘ └──────────┘ └──────────┘      │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────────────────────────────────────────────────┐  │
│  │  📈 CPU使用率の推移                                   │  │
│  │  100│              🔴━━━━━━━━━━━━━━━ 危険(90%)      │  │
│  │   90│     🟡━━━━━━━━━━━━━━━━━━━━━━━ 警告(80%)      │  │
│  │   80│🟢━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 正常(70%)      │  │
│  │     │  ╱╲    ╱╲    ╱╲    ╱╲                        │  │
│  │   50│╱  ╲  ╱  ╲  ╱  ╲  ╱  ╲                       │  │
│  │     └─────────────────────────────────→             │  │
│  │      10:00  12:00  14:00  16:00  18:00             │  │
│  └──────────────────────────────────────────────────────┘  │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────────────────┐ ┌──────────────────────────────┐ │
│  │  📋 サーバー別CPU    │ │  📊 時間帯別平均             │ │
│  │  server01  85% 🔴   │ │  ▮▮▮▮▮▮▮▮▮▮▮▮▮▮▮ 午前      │ │
│  │  server02  72% 🟡   │ │  ▮▮▮▮▮▮▮▮▮▮▮ 午後           │ │
│  │  server03  65% 🟢   │ │  ▮▮▮▮▮▮▮▮▮▮▮▮▮▮ 夜間        │ │
│  └──────────────────────┘ └──────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘

パネル1: 現在のCPU使用率(Single Value)

SPLクエリ

index="server_logs" sourcetype="linux:syslog"
| stats latest(cpu_usage) as 現在のCPU
| eval ステータス=case(
    現在のCPU<70, "正常",
    現在のCPU>=70 AND 現在のCPU<85, "警告",
    現在のCPU>=85, "危険"
)
| eval 色=case(
    現在のCPU<70, "#00FF00",
    現在のCPU>=70 AND 現在のCPU<85, "#FFFF00",
    現在のCPU>=85, "#FF0000"
)
| table 現在のCPU ステータス 色

Dashboard Studio設定

Visualization Type: Single Value

Configuration:
┌─────────────────────────────────────┐
│  Number Format                      │
│  ├─ Unit: %                         │
│  ├─ Decimal Places: 1               │
│  └─ Unit Position: After            │
│                                     │
│  Coloring                           │
│  ├─ Color Mode: By Value            │
│  └─ Use Field: 色                   │
│                                     │
│  Display                            │
│  ├─ Show Trend: Yes                 │
│  ├─ Show Sparkline: Yes             │
│  └─ Caption Field: ステータス        │
└─────────────────────────────────────┘

パネル2: CPU使用率の推移(Line Chart)

SPLクエリ

index="server_logs" sourcetype="linux:syslog"
| timechart span=30m avg(cpu_usage) as CPU使用率
| eval 正常線=if(CPU使用率<70, 100, null())
| eval 警告線=if(CPU使用率>=70 AND CPU使用率<85, 100, null())
| eval 危険線=if(CPU使用率>=85, 100, null())

Dashboard Studio設定

Series Configuration:
┌─────────────────────────────────────┐
│  CPU使用率                          │
│  ├─ Color: #000000                 │
│  ├─ Line Width: 3                  │
│  └─ Show Markers: Yes              │
│                                     │
│  正常線                             │
│  ├─ Color: #00FF00                 │
│  ├─ Line Width: 4                  │
│  ├─ Line Style: Dashed             │
│  └─ Name: 正常 (<70%)              │
│                                     │
│  警告線                             │
│  ├─ Color: #FFFF00                 │
│  ├─ Line Width: 5                  │
│  ├─ Line Style: Dashed             │
│  └─ Name: 警告 (70-85%)            │
│                                     │
│  危険線                             │
│  ├─ Color: #FF0000                 │
│  ├─ Line Width: 6                  │
│  ├─ Line Style: Dashed             │
│  └─ Name: 危険 (85%+)              │
└─────────────────────────────────────┘

パネル3: サーバー別CPU(Table)

SPLクエリ

index="server_logs" sourcetype="linux:syslog"
| stats avg(cpu_usage) as 平均CPU by host
| eval 平均CPU=round(平均CPU, 1)
| eval ステータス=case(
    平均CPU<70, "🟢 正常",
    平均CPU>=70 AND 平均CPU<85, "🟡 警告",
    平均CPU>=85, "🔴 危険"
)
| eval アイコン=case(
    平均CPU<70, "✅",
    平均CPU>=70 AND 平均CPU<85, "⚠️",
    平均CPU>=85, "🔴"
)
| table host 平均CPU ステータス アイコン
| rename host as "サーバー名", 平均CPU as "CPU使用率(%)"
| sort - "CPU使用率(%)"

Dashboard Studio設定

Table Configuration:
┌─────────────────────────────────────┐
│  Columns:                           │
│  ├─ サーバー名: Left aligned        │
│  ├─ CPU使用率: Right aligned        │
│  ├─ ステータス: Center aligned      │
│  └─ アイコン: Center aligned        │
│                                     │
│  Row Colors:                        │
│  ├─ Condition 1: CPU>=85 → Red     │
│  ├─ Condition 2: CPU>=70 → Yellow  │
│  └─ Condition 3: CPU<70 → Green    │
│                                     │
│  Options:                           │
│  ├─ Enable Sorting: Yes             │
│  ├─ Enable Search: Yes              │
│  └─ Rows Per Page: 10               │
└─────────────────────────────────────┘

パネル4: 時間帯別平均(Column Chart)

SPLクエリ

index="server_logs" sourcetype="linux:syslog"
| eval 時間帯=case(
    tonumber(strftime(_time, "%H"))>=6 AND tonumber(strftime(_time, "%H"))<12, "午前",
    tonumber(strftime(_time, "%H"))>=12 AND tonumber(strftime(_time, "%H"))<18, "午後",
    tonumber(strftime(_time, "%H"))>=18 OR tonumber(strftime(_time, "%H"))<6, "夜間"
)
| stats avg(cpu_usage) as 平均CPU by 時間帯
| eval 平均CPU=round(平均CPU, 1)

🌐 パート3: Webアクセス監視ダッシュボード

完成イメージ

┌─────────────────────────────────────────────────────────────┐
│  🌐 Webアクセス監視                      [🔄更新: 1分]       │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐      │
│  │ 総アクセス│ │ ユニーク │ │ エラー率 │ │ 平均応答 │      │
│  │ 🔢 15,234│ │ 🔢 8,521 │ │ 🔢 2.3% │ │ 🔢 185ms │      │
│  └──────────┘ └──────────┘ └──────────┘ └──────────┘      │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────────────────────────────────────────────────┐  │
│  │  📈 アクセス数の推移                                  │  │
│  │  2000│                🔴━━━━━━━━━━ 目標(1500)       │  │
│  │      │  ╱╲    ╱╲    ╱╲                             │  │
│  │  1000│╱  ╲  ╱  ╲  ╱  ╲                            │  │
│  │      └─────────────────────────────→                │  │
│  └──────────────────────────────────────────────────────┘  │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────────────────┐ ┌──────────────────────────────┐ │
│  │  📋 TOP 10 URL       │ │  🥧 ステータスコード分布     │ │
│  │  /index.html   3,542 │ │  ████ 200 OK (85%)          │ │
│  │  /api/data     2,145 │ │  ██ 404 Not Found (10%)     │ │
│  │  /login        1,832 │ │  █ 500 Error (5%)           │ │
│  └──────────────────────┘ └──────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘

パネル1: 総アクセス数(Single Value)

index="web_logs" sourcetype="apache:access"
| stats count as 総アクセス数
| eval 前日比=50
| eval トレンド=if(前日比>0, "↑", "↓")
| eval 前日比表示=トレンド." ".abs(前日比)."%"
| table 総アクセス数 前日比表示

パネル2: アクセス数推移(Area Chart)

index="web_logs" sourcetype="apache:access"
| timechart span=1h count as アクセス数
| eval 目標=1500
| eval 未達成=if(アクセス数<目標, 目標, null())
| eval 達成=if(アクセス数>=目標, 目標, null())

設定:

Series Configuration:
- アクセス数: Area, #0066CC, Opacity 0.7
- 未達成: Line, #FF0000, Dashed, Width 4
- 達成: Line, #00FF00, Dashed, Width 4

パネル3: TOP 10 URL(Table)

index="web_logs" sourcetype="apache:access"
| stats count as アクセス数 by uri
| sort - アクセス数
| head 10
| eval ランク=1
| accum ランク
| eval バー="|".repeat(floor(アクセス数/100), "█")
| table ランク uri アクセス数 バー
| rename uri as "URL", アクセス数 as "アクセス数", バー as "グラフ"

パネル4: ステータスコード分布(Pie Chart)

index="web_logs" sourcetype="apache:access"
| stats count by status
| eval ステータス名=case(
    status=200, "200 OK",
    status=404, "404 Not Found",
    status=500, "500 Error",
    1=1, status." その他"
)
| table ステータス名 count

パネル5: エラー率(Single Value with Trend)

index="web_logs" sourcetype="apache:access"
| stats count as 総数, count(eval(status>=400)) as エラー数
| eval エラー率=round((エラー数/総数)*100, 2)
| eval 色=case(
    エラー率<1, "#00FF00",
    エラー率>=1 AND エラー率<5, "#FFFF00",
    エラー率>=5, "#FF0000"
)
| table エラー率 色

🚨 パート4: エラー監視ダッシュボード

完成イメージ

┌─────────────────────────────────────────────────────────────┐
│  🚨 エラー監視ダッシュボード                 [🔄更新: 1分]  │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐      │
│  │ 総エラー │ │ Critical │ │ Warning  │ │ 影響ユーザー│    │
│  │ 🔢 156   │ │ 🔢 23    │ │ 🔢 133   │ │ 🔢 1,245  │    │
│  │ 🔴 急増  │ │ 🔴 危険  │ │ 🟡 注意  │ │ ⚠️ 要対応 │    │
│  └──────────┘ └──────────┘ └──────────┘ └──────────┘      │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────────────────────────────────────────────────┐  │
│  │  📈 エラー発生数の推移                                │  │
│  │  100│        🔴━━━━━━━━━━━━━━━━━━ Critical(50)      │  │
│  │   50│  🟡━━━━━━━━━━━━━━━━━━━━━━━━ Warning(30)      │  │
│  │     │🟢━━━━━━━━━━━━━━━━━━━━━━━━━━ Normal(10)       │  │
│  │     │    ╱╲╱╲                                       │  │
│  │     └─────────────────────────────────→             │  │
│  └──────────────────────────────────────────────────────┘  │
├─────────────────────────────────────────────────────────────┤
│  ┌──────────────────────────────────────────────────────┐  │
│  │  📋 エラー詳細ログ(直近10件)                        │  │
│  │  時刻        レベル   メッセージ           サーバー   │  │
│  │  10:15:30   🔴CRIT   DB接続失敗          server01   │  │
│  │  10:14:22   🟡WARN   メモリ不足           server02   │  │
│  │  10:13:15   🔴CRIT   API timeout         server03   │  │
│  └──────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────┘

パネル1: 総エラー数with増減(Single Value)

index="app_logs" (level="ERROR" OR level="CRITICAL")
| stats count as 総エラー数
| appendcols [
    search index="app_logs" (level="ERROR" OR level="CRITICAL") earliest=-1h@h latest=@h
    | stats count as 前時間
]
| eval 増減率=round(((総エラー数-前時間)/前時間)*100, 1)
| eval トレンド=case(
    増減率>50, "🔴 急増",
    増減率>20, "🟡 増加",
    増減率>-20, "➡️ 横ばい",
    1=1, "🟢 減少"
)
| eval 色=case(
    増減率>50, "#FF0000",
    増減率>20, "#FFFF00",
    1=1, "#00FF00"
)
| table 総エラー数 トレンド 増減率 色

パネル2: エラーレベル別推移(Line Chart)

index="app_logs" (level="ERROR" OR level="CRITICAL" OR level="WARNING")
| timechart span=10m count by level
| eval Critical線=if(count_CRITICAL>0, 50, null())
| eval Warning線=if(count_WARNING>0, 30, null())
| eval Normal線=10

設定:

Series Configuration:
┌─────────────────────────────────────┐
│  count_CRITICAL                     │
│  ├─ Color: #FF0000                 │
│  ├─ Line Width: 3                  │
│  └─ Name: Critical                 │
│                                     │
│  count_WARNING                      │
│  ├─ Color: #FFAA00                 │
│  ├─ Line Width: 2                  │
│  └─ Name: Warning                  │
│                                     │
│  count_ERROR                        │
│  ├─ Color: #FF6600                 │
│  ├─ Line Width: 2                  │
│  └─ Name: Error                    │
│                                     │
│  Critical線                         │
│  ├─ Color: #FF0000                 │
│  ├─ Line Style: Dashed             │
│  └─ Name: Critical閾値(50件)       │
└─────────────────────────────────────┘

パネル3: エラー詳細ログ(Table with Formatting)

index="app_logs" (level="ERROR" OR level="CRITICAL" OR level="WARNING")
| eval 時刻=strftime(_time, "%H:%M:%S")
| eval レベルアイコン=case(
    level="CRITICAL", "🔴 CRITICAL",
    level="ERROR", "🟠 ERROR",
    level="WARNING", "🟡 WARNING"
)
| eval メッセージ短縮=substr(message, 1, 50)."..."
| table 時刻 レベルアイコン メッセージ短縮 host
| rename 時刻 as "発生時刻", レベルアイコン as "レベル", メッセージ短縮 as "メッセージ", host as "サーバー"
| head 10

Table設定:

Row Highlighting:
┌─────────────────────────────────────┐
│  Condition-based coloring:          │
│  ├─ Contains "CRITICAL" → Red bg   │
│  ├─ Contains "ERROR" → Orange bg   │
│  └─ Contains "WARNING" → Yellow bg │
│                                     │
│  Column Width:                      │
│  ├─ 発生時刻: 100px                 │
│  ├─ レベル: 120px                   │
│  ├─ メッセージ: Auto                │
│  └─ サーバー: 100px                 │
└─────────────────────────────────────┘

🔗 パート5: 複数パネルの連携【ドリルダウン】

ドリルダウンとは?

親パネル(クリック可能)
┌─────────────────────────────────────┐
│  📊 サーバー別CPU使用率              │
│  ┌─────────────────────────────┐   │
│  │ server01  85% ← クリック!  │   │
│  │ server02  72%               │   │
│  │ server03  65%               │   │
│  └─────────────────────────────┘   │
└─────────────────────────────────────┘
         ↓ ドリルダウン
子パネル(詳細表示)
┌─────────────────────────────────────┐
│  📈 server01の詳細グラフ             │
│  ┌─────────────────────────────┐   │
│  │  CPU、メモリ、ディスクの推移  │   │
│  │  プロセス一覧                │   │
│  │  ネットワーク使用量           │   │
│  └─────────────────────────────┘   │
└─────────────────────────────────────┘

実装方法【ステップバイステップ】

STEP 1: 親パネル(サーバー一覧)作成

index="server_logs" sourcetype="linux:syslog"
| stats avg(cpu_usage) as CPU使用率 by host
| eval CPU使用率=round(CPU使用率, 1)
| table host CPU使用率
| rename host as "サーバー名"

STEP 2: ドリルダウン設定

Dashboard Studio設定:
┌─────────────────────────────────────┐
│  Configuration > Interactions       │
├─────────────────────────────────────┤
│  On Click:                          │
│  ┌───────────────────────────────┐ │
│  │ ◉ Link to Dashboard           │ │
│  │ ○ Link to URL                 │ │
│  │ ○ Run Custom Code             │ │
│  └───────────────────────────────┘ │
│                                     │
│  Dashboard: [サーバー詳細_____▼]   │
│                                     │
│  Token Settings:                    │
│  ├─ Field: サーバー名               │
│  ├─ Token Name: selected_server    │
│  └─ Pass Token: Yes                │
│                                     │
│  [ Save ]                           │
└─────────────────────────────────────┘

STEP 3: 子ダッシュボード(詳細画面)作成

新規ダッシュボード「サーバー詳細」を作成

index="server_logs" sourcetype="linux:syslog" host=$selected_server$
| timechart span=10m 
    avg(cpu_usage) as CPU
    avg(memory_usage) as メモリ
    avg(disk_usage) as ディスク

Tokenの設定:

Dashboard Settings > Tokens
┌─────────────────────────────────────┐
│  Default Token Values:              │
│  ┌───────────────────────────────┐ │
│  │ Token: selected_server        │ │
│  │ Default: server01             │ │
│  │ Type: String                  │ │
│  └───────────────────────────────┘ │
└─────────────────────────────────────┘

ドリルダウンの実践パターン

パターン 親パネル 子パネル 用途
サーバー詳細 サーバー一覧 個別サーバー監視 インフラ監視
エラー詳細 エラー統計 エラーログ詳細 トラブルシュート
ユーザー分析 ユーザー一覧 個別ユーザー行動 行動分析
URL分析 アクセスTOP10 個別URL詳細 Web分析
期間ドリル 月次グラフ 日次詳細 トレンド分析

🎛️ パート6: フィルター・タイムピッカー【実装】

タイムピッカーの設定

Dashboard Settings > Time Range Picker
┌─────────────────────────────────────┐
│  Enable Time Picker: ✅ Yes         │
│                                     │
│  Preset Ranges:                     │
│  ✅ Last 15 minutes                 │
│  ✅ Last 1 hour                     │
│  ✅ Last 4 hours                    │
│  ✅ Last 24 hours                   │
│  ✅ Last 7 days                     │
│  ✅ Last 30 days                    │
│  ☑️ Custom range                   │
│                                     │
│  Default Selection:                 │
│  [Last 24 hours___________▼]       │
│                                     │
│  Token Name:                        │
│  [global_time_____________________]│
│                                     │
│  [ Save ]                           │
└─────────────────────────────────────┘

ドロップダウンフィルター(サーバー選択)

STEP 1: Input追加

Dashboard > Add Input > Dropdown
┌─────────────────────────────────────┐
│  Input Type: Dropdown               │
│                                     │
│  Label: サーバー選択                 │
│                                     │
│  Token: selected_host               │
│                                     │
│  Search:                            │
│  ┌───────────────────────────────┐ │
│  │ index="server_logs"           │ │
│  │ | stats count by host         │ │
│  │ | table host                  │ │
│  └───────────────────────────────┘ │
│                                     │
│  Default Value: *                   │
│                                     │
│  Allow Multiple: ☑️ Yes            │
│                                     │
│  [ Add ]                            │
└─────────────────────────────────────┘

STEP 2: パネルでTokenを使用

index="server_logs" sourcetype="linux:syslog" host=$selected_host$
| timechart span=30m avg(cpu_usage) as CPU使用率

動作:

ユーザーがドロップダウンで「server01」を選択
↓
$selected_host$ が "server01" に置き換わる
↓
index="server_logs" sourcetype="linux:syslog" host="server01"
↓
server01のデータだけが表示される

複数フィルターの組み合わせ

ダッシュボード上部:
┌─────────────────────────────────────────────────────────────┐
│  📅 期間: [直近24時間 ▼]                                    │
│  🖥️ サーバー: [全て ▼]                                      │
│  📊 メトリクス: [CPU ▼]                                     │
│  ⚠️ レベル: [全て ▼]                                        │
└─────────────────────────────────────────────────────────────┘

SPLでの使用:
index="server_logs" 
    sourcetype="linux:syslog" 
    host=$selected_host$ 
    level=$selected_level$
| timechart span=30m avg($selected_metric$) as 値

Input一覧表

Inputタイプ 用途 Token例 SPL例
Time Picker 期間選択 $global_time$ earliest=$global_time.earliest$
Dropdown 単一選択 $selected_host$ host=$selected_host$
Multiselect 複数選択 $selected_hosts$ host IN ($selected_hosts$)
Text Input 文字入力 $search_text$ message="*$search_text$*"
Radio 選択肢 $metric_type$ `
Checkbox ON/OFF $show_errors$ `

📊 パート7: 自動更新とアラート

自動更新設定

Panel Configuration > Refresh
┌─────────────────────────────────────┐
│  Auto Refresh:                      │
│  ┌───────────────────────────────┐ │
│  │ ◉ Enabled                     │ │
│  │ ○ Disabled                    │ │
│  └───────────────────────────────┘ │
│                                     │
│  Refresh Interval:                  │
│  ┌───────────────────────────────┐ │
│  │ ○ 10 seconds                  │ │
│  │ ○ 30 seconds                  │ │
│  │ ◉ 1 minute                    │ │
│  │ ○ 5 minutes                   │ │
│  │ ○ 30 minutes                  │ │
│  │ ○ 1 hour                      │ │
│  └───────────────────────────────┘ │
│                                     │
│  [ Save ]                           │
└─────────────────────────────────────┘

更新間隔の使い分け

間隔 用途 CPU負荷 推奨度
10秒 リアルタイム監視(障害時) 🔥🔥🔥 高 ⚠️ 短期間のみ
30秒 準リアルタイム監視 🔥🔥 中高 ⚠️ 必要時のみ
1分 通常のリアルタイム監視 🔥 中 ✅ 推奨
5分 定期監視 🌡️ 低 ✅ 推奨
30分 トレンド監視 ❄️ 極小 ✅ レポート用
1時間 定期レポート ❄️ 極小 ✅ 統計用

アラート連携SPL

index="server_logs" sourcetype="linux:syslog"
| stats avg(cpu_usage) as CPU使用率 by host
| where CPU使用率 > 85
| eval アラートメッセージ="[CRITICAL] ".host." のCPU使用率が ".CPU使用率."% に達しました"
| eval 優先度=case(
    CPU使用率>=95, "P1-緊急",
    CPU使用率>=90, "P2-重要",
    CPU使用率>=85, "P3-警告"
)
| table host CPU使用率 優先度 アラートメッセージ

👥 パート8: 共有・権限管理

ダッシュボードの共有設定

Dashboard > Settings > Permissions
┌─────────────────────────────────────┐
│  Sharing:                           │
│  ┌───────────────────────────────┐ │
│  │ ◉ App (全ユーザー)            │ │
│  │ ○ Private (自分のみ)          │ │
│  └───────────────────────────────┘ │
│                                     │
│  Permissions:                       │
│  ┌───────────────────────────────┐ │
│  │ Role         Read   Write     │ │
│  │ ─────────────────────────     │ │
│  │ admin        ✅     ✅        │ │
│  │ power        ✅     ✅        │ │
│  │ user         ✅     ❌        │ │
│  │ viewer       ✅     ❌        │ │
│  └───────────────────────────────┘ │
│                                     │
│  [ Save ]                           │
└─────────────────────────────────────┘

権限設定パターン

シナリオ 設定 理由
経営層向けダッシュボード App / Read Only 全員が閲覧、編集は管理者のみ
チーム監視ダッシュボード App / Team Write チームメンバーが共同編集
個人用ダッシュボード Private 自分専用の分析
顧客向けダッシュボード App / Read Only 顧客は閲覧のみ

⚡ パート9: パフォーマンス最適化

最適化チェックリスト

項目 悪い例 良い例 効果
時間範囲 earliest=0(全期間) earliest=-24h(24時間) 🚀🚀🚀
index指定 なし index="server_logs" 🚀🚀🚀
sourcetype指定 なし sourcetype="linux:syslog" 🚀🚀
フィールド指定 ` table *`(全部) `
集計粒度 span=1s(1秒) span=30m(30分) 🚀🚀
自動更新 10秒 1分〜5分 🚀
パネル数 20個以上 10個以下 🚀

重いクエリの改善例

❌ 悪い例(遅い)

index="*" 
| stats avg(cpu_usage) by host
| timechart span=1m avg(cpu_usage)

問題点:

  • 全indexを検索(遅い)
  • sourcetype指定なし(データ混在)
  • span=1mで細かすぎ(データ量多)

✅ 良い例(速い)

index="server_logs" sourcetype="linux:syslog" earliest=-24h
| timechart span=30m avg(cpu_usage) as CPU使用率
| fields _time CPU使用率

改善点:

  • index指定(検索範囲を限定)
  • sourcetype指定(正確なデータ)
  • earliest指定(24時間のみ)
  • span=30m(適度な粒度)
  • 必要なフィールドのみ(データ量削減)

📋 パート10: 実務チェックリスト

ダッシュボード公開前チェック

□ データ取得
  □ index指定あり
  □ sourcetype指定あり
  □ 時間範囲指定あり
  □ データが正しく表示される
  
□ ビジュアル
  □ 色が見やすい(色覚多様性対応)
  □ フォントサイズが適切
  □ グラフタイプが適切
  □ 凡例が表示される
  
□ 動的基準線
  □ if文でnull()使用
  □ 色が条件ごとに変わる
  □ 線の太さが適切
  
□ インタラクション
  □ フィルターが動作する
  □ タイムピッカーが動作する
  □ ドリルダウンが動作する(必要な場合)
  
□ パフォーマンス
  □ 表示が5秒以内
  □ 自動更新間隔が適切
  □ パネル数が10個以下
  
□ 共有設定
  □ 権限設定が適切
  □ 説明文が記載されている
  □ タイトルがわかりやすい
  
□ 運用
  □ アラート設定(必要な場合)
  □ 更新頻度が適切
  □ ドキュメント作成

🎓 まとめ【実務で使える完全SPL集】

CPU監視(コピペ用)

index="server_logs" sourcetype="linux:syslog"
| timechart span=30m avg(cpu_usage) as CPU
| eval 正常=if(CPU<70,100,null())
| eval 警告=if(CPU>=70 AND CPU<85,100,null())
| eval 危険=if(CPU>=85,100,null())

アクセス監視(コピペ用)

index="web_logs" sourcetype="apache:access"
| timechart span=1h count as アクセス数
| eval 目標=1500
| eval 未達成=if(アクセス数<目標,目標,null())
| eval 達成=if(アクセス数>=目標,目標,null())

エラー監視(コピペ用)

index="app_logs" (level="ERROR" OR level="CRITICAL")
| timechart span=10m count as エラー数
| eval 正常=if(エラー数<10,50,null())
| eval 警告=if(エラー数>=10 AND エラー数<30,50,null())
| eval 危険=if(エラー数>=30,50,null())

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?