Skip to content

Commit f21e0d1

Browse files
Copilotdevinslick
andcommitted
Add support for private dashboards with sharing level filter and display
Co-authored-by: devinslick <[email protected]>
1 parent 37e13f1 commit f21e0d1

File tree

5 files changed

+63
-21
lines changed

5 files changed

+63
-21
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,22 @@ The `caca_metrics` index should be created automatically. Verify by running:
116116
Run the registry update search to populate the dashboard registry:
117117

118118
```spl
119-
| rest /services/data/ui/views splunk_server=local count=0
119+
| rest /services/data/ui/views splunk_server=local count=0 search="sharing=*"
120120
| search isDashboard=1 OR isVisible=1
121121
| eval dashboard_uri="/app/".eai:acl.app."/".title
122122
| eval pretty_name=coalesce(label, title)
123123
| eval app=eai:acl.app
124124
| eval owner=eai:acl.owner
125+
| eval sharing=eai:acl.sharing
125126
| eval description=coalesce(eai:data, "")
126127
| eval status="active"
127-
| table dashboard_uri pretty_name app owner description status
128+
| table dashboard_uri pretty_name app owner sharing description status
128129
| outputlookup dashboard_registry.csv
129130
```
130131

131-
This will scan your Splunk environment and populate the `dashboard_registry.csv` lookup with all discovered dashboards.
132+
This will scan your Splunk environment and populate the `dashboard_registry.csv` lookup with all discovered dashboards, including private dashboards.
133+
134+
**Note on Private Dashboards:** The `search="sharing=*"` parameter ensures that dashboards with all sharing levels (global, app, and user/private) are included in the registry. To see private dashboards owned by other users, the scheduled search must run with appropriate permissions (typically as admin or with the `list_storage_passwords` capability).
132135

133136
**Verify the registry:**
134137

@@ -455,17 +458,20 @@ Edit `lookups/dashboard_registry.csv` and set `status=inactive` for specific das
455458

456459
Run the registry update search manually:
457460
```spl
458-
| rest /services/data/ui/views splunk_server=local count=0
461+
| rest /services/data/ui/views splunk_server=local count=0 search="sharing=*"
459462
| search isDashboard=1 OR isVisible=1
460463
| eval dashboard_uri="/app/".eai:acl.app."/".title
461464
| eval pretty_name=coalesce(label, title)
462465
| eval app=eai:acl.app
463466
| eval owner=eai:acl.owner
467+
| eval sharing=eai:acl.sharing
464468
| eval status="active"
465-
| table dashboard_uri pretty_name app owner status
469+
| table dashboard_uri pretty_name app owner sharing status
466470
| outputlookup dashboard_registry.csv
467471
```
468472

473+
**For Private Dashboards:** If private dashboards still don't appear, ensure the search is running with appropriate permissions. Private dashboards owned by other users require admin privileges or specific capabilities to be discovered via REST API.
474+
469475
Or add it manually to `lookups/dashboard_registry.csv`.
470476

471477
### Metrics Showing Zero

default/data/ui/views/CACA_ADMIN_README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,19 @@ To use the CACA Admin Dashboard effectively, you need:
185185
- Verify the dashboard registry is populated: `| inputlookup dashboard_registry`
186186
- Check that metrics are being collected: `| mstats count WHERE index=caca_metrics`
187187
- Ensure filters aren't too restrictive (try resetting to defaults)
188+
- **For private dashboards**: Ensure the "Dashboard Registry - Auto Update" scheduled search runs with appropriate permissions to discover private dashboards owned by other users
188189

189190
### Filters Not Working
190191
- Click the "Submit" button after changing filters
191192
- Check for typos in the name filter (use wildcards: *)
192193
- Verify app/owner names match exactly what's in the registry
193194

195+
### Private Dashboards Not Appearing
196+
- Private dashboards require the registry update search to run with admin privileges
197+
- Verify the search includes `search="sharing=*"` parameter in the REST call
198+
- Check if the user running the scheduled search has permissions to view other users' private content
199+
- Manually verify private dashboard exists: `| rest /services/data/ui/views search="sharing=*" | search owner="username" sharing="user"`
200+
194201
### Links Not Working
195202
- Ensure you have appropriate permissions to access management pages
196203
- Some links require admin or power user roles
@@ -205,6 +212,13 @@ To use the CACA Admin Dashboard effectively, you need:
205212
- `caca_metrics` index
206213
- Search macro: `get_all_dashboards_summary`
207214

215+
**Private Dashboard Support**:
216+
- The dashboard registry includes dashboards with all sharing levels: global, app, and user/private
217+
- The registry update search uses `search="sharing=*"` parameter to discover private dashboards
218+
- Viewing private dashboards owned by other users requires appropriate permissions
219+
- The scheduled search should run with admin privileges to capture all private dashboards across users
220+
- The `sharing` field in the registry indicates the sharing level of each dashboard
221+
208222
**Performance Considerations**:
209223
- Initial load may take a few seconds if you have many dashboards
210224
- Filters are applied on submit to improve performance

default/data/ui/views/caca_admin.xml

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@
4343
<delimiter> OR </delimiter>
4444
</input>
4545

46+
<input type="multiselect" token="sharing_filter">
47+
<label>Filter by Sharing Level</label>
48+
<choice value="*">All Sharing Levels</choice>
49+
<choice value="global">🌐 Global</choice>
50+
<choice value="app">📦 App</choice>
51+
<choice value="user">🔒 Private</choice>
52+
<default>*</default>
53+
<initialValue>*</initialValue>
54+
<valuePrefix>sharing="</valuePrefix>
55+
<valueSuffix>"</valueSuffix>
56+
<delimiter> OR </delimiter>
57+
</input>
58+
4659
<input type="multiselect" token="health_filter">
4760
<label>Filter by Health Status</label>
4861
<choice value="*">All Status</choice>
@@ -85,8 +98,8 @@
8598
<single>
8699
<search>
87100
<query>`get_all_dashboards_summary`
88-
| lookup dashboard_registry pretty_name OUTPUT owner description dashboard_uri
89-
| search pretty_name="$name_filter$" $app_filter$ $owner_filter$ $health_filter$
101+
| lookup dashboard_registry pretty_name OUTPUT owner sharing description dashboard_uri
102+
| search pretty_name="$name_filter$" $app_filter$ $owner_filter$ $sharing_filter$ $health_filter$
90103
| eval perf_category=case(
91104
avg_load_time_7d == 0, "unknown",
92105
avg_load_time_7d &lt; 1000, "fast",
@@ -110,8 +123,8 @@
110123
<single>
111124
<search>
112125
<query>`get_all_dashboards_summary`
113-
| lookup dashboard_registry pretty_name OUTPUT owner description dashboard_uri
114-
| search pretty_name="$name_filter$" $app_filter$ $owner_filter$ $health_filter$
126+
| lookup dashboard_registry pretty_name OUTPUT owner sharing description dashboard_uri
127+
| search pretty_name="$name_filter$" $app_filter$ $owner_filter$ $sharing_filter$ $health_filter$
115128
| eval perf_category=case(
116129
avg_load_time_7d == 0, "unknown",
117130
avg_load_time_7d &lt; 1000, "fast",
@@ -136,8 +149,8 @@
136149
<single>
137150
<search>
138151
<query>`get_all_dashboards_summary`
139-
| lookup dashboard_registry pretty_name OUTPUT owner description dashboard_uri
140-
| search pretty_name="$name_filter$" $app_filter$ $owner_filter$ $health_filter$
152+
| lookup dashboard_registry pretty_name OUTPUT owner sharing description dashboard_uri
153+
| search pretty_name="$name_filter$" $app_filter$ $owner_filter$ $sharing_filter$ $health_filter$
141154
| eval perf_category=case(
142155
avg_load_time_7d == 0, "unknown",
143156
avg_load_time_7d &lt; 1000, "fast",
@@ -163,8 +176,8 @@
163176
<single>
164177
<search>
165178
<query>`get_all_dashboards_summary`
166-
| lookup dashboard_registry pretty_name OUTPUT owner description dashboard_uri
167-
| search pretty_name="$name_filter$" $app_filter$ $owner_filter$ $health_filter$
179+
| lookup dashboard_registry pretty_name OUTPUT owner sharing description dashboard_uri
180+
| search pretty_name="$name_filter$" $app_filter$ $owner_filter$ $sharing_filter$ $health_filter$
168181
| eval perf_category=case(
169182
avg_load_time_7d == 0, "unknown",
170183
avg_load_time_7d &lt; 1000, "fast",
@@ -214,8 +227,8 @@
214227
<table>
215228
<search>
216229
<query>`get_all_dashboards_summary`
217-
| lookup dashboard_registry pretty_name OUTPUT owner description dashboard_uri
218-
| search pretty_name="$name_filter$" $app_filter$ $owner_filter$ $health_filter$
230+
| lookup dashboard_registry pretty_name OUTPUT owner sharing description dashboard_uri
231+
| search pretty_name="$name_filter$" $app_filter$ $owner_filter$ $sharing_filter$ $health_filter$
219232
| eval perf_category=case(
220233
avg_load_time_7d == 0, "unknown",
221234
avg_load_time_7d &lt; 1000, "fast",
@@ -236,10 +249,15 @@
236249
health_status=="critical", "✗ Critical",
237250
health_status=="stale", "☾ Stale",
238251
1=1, health_status)
252+
| eval sharing_display=case(
253+
sharing=="global", "🌐 Global",
254+
sharing=="app", "📦 App",
255+
sharing=="user", "🔒 Private",
256+
1=1, coalesce(sharing, "-"))
239257
| eval dashboard_link=dashboard_uri
240258
| eval title_from_uri=mvindex(split(dashboard_uri, "/"), -1)
241-
| table pretty_name app owner views_7d edits_7d errors_7d avg_load_time_7d perf_rating health_badge dashboard_link title_from_uri
242-
| rename pretty_name as "Dashboard Name", app as "App", owner as "Owner", views_7d as "Views (7d)", edits_7d as "Edits (7d)", errors_7d as "Errors (7d)", avg_load_time_7d as "Avg Load (ms)", perf_rating as "Performance", health_badge as "Health", dashboard_link as "Dashboard URI", title_from_uri as "Title"
259+
| table pretty_name app owner sharing_display views_7d edits_7d errors_7d avg_load_time_7d perf_rating health_badge dashboard_link title_from_uri
260+
| rename pretty_name as "Dashboard Name", app as "App", owner as "Owner", sharing_display as "Sharing", views_7d as "Views (7d)", edits_7d as "Edits (7d)", errors_7d as "Errors (7d)", avg_load_time_7d as "Avg Load (ms)", perf_rating as "Performance", health_badge as "Health", dashboard_link as "Dashboard URI", title_from_uri as "Title"
243261
| sort - "Views (7d)"</query>
244262
<earliest>$time_range.earliest$</earliest>
245263
<latest>$time_range.latest$</latest>
@@ -255,6 +273,9 @@
255273
<format type="color" field="Performance">
256274
<colorPalette type="map">{"⚡ Fast":#53A051,"✓ Good":#0877a6,"⚠ Slow":#F8BE34,"✗ Very Slow":#DC4E41,"-":#708794}</colorPalette>
257275
</format>
276+
<format type="color" field="Sharing">
277+
<colorPalette type="map">{"🌐 Global":#0877a6,"📦 App":#53A051,"🔒 Private":#F8BE34,"-":#708794}</colorPalette>
278+
</format>
258279
<format type="number" field="Views (7d)">
259280
<option name="precision">0</option>
260281
</format>
@@ -353,7 +374,7 @@
353374
<table>
354375
<search>
355376
<query>`get_all_dashboards_summary`
356-
| lookup dashboard_registry pretty_name OUTPUT owner description dashboard_uri
377+
| lookup dashboard_registry pretty_name OUTPUT owner sharing description dashboard_uri
357378
| eval avg_load_time_7d=round(avg_load_time_7d, 0)
358379
| eval recommendation=case(
359380
health_status=="critical" AND avg_load_time_7d &gt; 5000, "URGENT: Fix errors AND optimize performance",

default/savedsearches.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,18 @@ description = Automatically updates dashboard registry via REST API, respecting
105105
dispatch.earliest_time = -5m
106106
dispatch.latest_time = now
107107
enableSched = 0
108-
search = | rest /services/data/ui/views splunk_server=local count=0 \
108+
search = | rest /services/data/ui/views splunk_server=local count=0 search="sharing=*" \
109109
| search isDashboard=1 OR isVisible=1 \
110110
| eval dashboard_uri="/app/".eai:acl.app."/".title \
111111
| eval pretty_name=coalesce(label, title) \
112112
| eval app=eai:acl.app \
113113
| eval owner=eai:acl.owner \
114+
| eval sharing=eai:acl.sharing \
114115
| eval description=coalesce(eai:data, "") \
115116
| eval status="active" \
116117
| lookup app_filter app OUTPUT include \
117118
| where isnull(include) OR include="true" OR include="1" OR include="yes" \
118119
| fields - include \
119-
| table dashboard_uri pretty_name app owner description status \
120+
| table dashboard_uri pretty_name app owner sharing description status \
120121
| outputlookup dashboard_registry.csv
121122
schedule_priority = low

lookups/dashboard_registry.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dashboard_uri,pretty_name,app,owner,description,status
1+
dashboard_uri,pretty_name,app,owner,sharing,description,status

0 commit comments

Comments
 (0)