RousselTMLEARNING

Observability

Dashboards, reports and alerts in Splunk

Making the most of Splunk searches: reports and scheduling, Dashboard Studio dashboards (data sources, visualizations, inputs and tokens) and Simple XML, scheduled and real-time alerts, conditions, throttling and actions, and automation with the REST API and Python SDK.

1. Reports #

A saved and shared search.

Principle #

  • A report is a saved search with its visualization; it can be shared, scheduled (e-mailed as PDF or CSV) and embedded in dashboards.
  • Report acceleration precomputes results of a heavy, repeated search.
  • A summary index (| collect index=summary or scheduled summary) stores hourly aggregates for cheap long trends.
Watch out : Scheduled searches run with their owner's permissions: a report scheduled by an admin and shared with everyone can expose sensitive indexes.

2. Dashboards #

Dashboard Studio and Simple XML.

Dashboard Studio #

Studio structure
{
  "title": "Boutique",
  "dataSources": {
    "ds_errors": { "type": "ds.search", "options": { "query": "index=web status>=500 | timechart span=5m count" } },
    "ds_p95":     { "type": "ds.search", "options": { "query": "index=web | stats perc95(duration_ms) AS p95 BY uri | sort -p95" } }
  },
  "visualizations": {
    "viz_errors": { "type": "splunk.line",  "title": "5xx errors", "dataSources": { "primary": "ds_errors" } },
    "viz_p95":     { "type": "splunk.table", "title": "p95 per URL", "dataSources": { "primary": "ds_p95" } }
  },
  "inputs": {},
  "defaults": {},
  "layout": {
    "type": "absolute",
    "options": { "width": 1440, "height": 700 },
    "structure": [
      { "item": "viz_errors", "type": "block", "position": { "x": 20, "y": 20, "w": 900, "h": 320 } },
      { "item": "viz_p95",     "type": "block", "position": { "x": 940, "y": 20, "w": 480, "h": 320 } }
    ]
  }
}
  • Dashboard Studio (JSON definition) is the recommended editor: free or grid layout, tabs, many visualizations; Simple XML (classic dashboards) remains supported.
  • A base data source followed by chains (ds.chain) avoids running the same search several times.
  • Inputs (time, dropdown, text) set tokens used in queries: index=web uri=$uri$.
Best practice : A dashboard running ten searches each time it opens weighs on the whole platform: use base searches, scheduled reports or tstats.

3. Alerts #

Searches that trigger actions.

The pipeline #

Alert pipeline
SettingRole
Typescheduled (cron, recommended) or real-time (costly, keep for critical cases)
Conditionnumber of results, hosts, sources, or custom search (search count > 10)
Triggeronce, or for each result
Throttlesuppresses repeated triggers for a period, optionally per field
Actionse-mail, webhook, log an event, output to lookup, Slack, Teams, PagerDuty, ServiceNow via apps

Via the API #

# Create a scheduled alert with the REST API
curl -sk -u admin:$SPLUNK_PASSWORD https://localhost:8089/servicesNS/admin/search/saved/searches \
  -d name=boutique_erreurs_5xx --data-urlencode search='index=web status>=500' \
  -d is_scheduled=1 -d cron_schedule='*/5 * * * *' \
  -d dispatch.earliest_time=-5m -d dispatch.latest_time=now \
  -d alert_type='number of events' -d alert_comparator='greater than' -d alert_threshold=10 \
  -d alert.track=1 -d alert.severity=4 -d alert.suppress=1 -d alert.suppress.period=30m
pip install splunk-sdk==3.0.1
python3 - <<'EOF'
import splunklib.client as client, splunklib.results as results
s = client.connect(host='localhost', port=8089, username='admin', password='…', verify=False)
for r in results.JSONResultsReader(s.jobs.oneshot('search index=web status>=500 earliest=-1h | stats count by uri', output_mode='json')):
    print(r)
EOF

The REST API (port 8089) gives access to everything: searches (/services/search/jobs, /services/search/jobs/export), saved objects, inputs, indexes, users. Fired alerts can be read with | rest /servicesNS/-/-/alerts/fired_alerts.

Commands to know #

Commands to know
  • | rest /servicesNS/-/-/saved/searches | table title cron_schedule is_scheduled : list scheduled searches
  • index=_internal sourcetype=scheduler status=skipped : skipped scheduled searches
  • curl -sk -u admin:… https://localhost:8089/services/search/jobs/export -d search="…" : run a search via the API
  • | collect index=resume : write to a summary index

Sources #

Checked in November 2026 (Splunk Enterprise 10.6): check the release notes before relying on a detail, Splunk Cloud Platform evolves faster than the on-premises version.

Related articles

Splunk: the machine data platform at a glance

Discover Splunk: the platform's role, components (forwarders, indexers, search heads), ports, events and defa…

Installing Splunk and ingesting data

Installing Splunk Enterprise (package or Docker), understanding $SPLUNK_HOME and configuration file precedenc…

SPL: Splunk search fundamentals

Learning the SPL language: search structure, time range and time modifiers, search modes, filtering commands …

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!