Comprehensive documentation for Dashpub - A modern Splunk dashboard publishing system
Complete API documentation for Dashpub endpoints.
All API endpoints are prefixed with /api:
http://localhost:3000/api
Most endpoints are public. Some endpoints require authentication if JWT_REQUIRED=true:
# Include JWT token in cookie or header
Cookie: jwt_token=your-jwt-token
GET /api/dashboards
Returns a list of all available dashboards.
Response:
{
"dashboards": [
{
"id": "dashboard-id",
"name": "Dashboard Name",
"description": "Dashboard description",
"path": "/api/dashboards/dashboard-id/definition",
"url": "/dashboard/dashboard-id",
"tags": ["tag1", "tag2"]
}
],
"metadata": {
"total": 1,
"lastUpdated": "2024-01-15T10:30:00Z"
}
}
GET /api/dashboards/:id/definition
Returns the complete dashboard definition JSON.
Parameters:
id (path) - Dashboard IDResponse:
{
"id": "dashboard-id",
"title": "Dashboard Title",
"layout": { ... },
"dataSources": { ... },
"visualizations": [ ... ],
"screenshotUrl": "/screenshots/dashboard-id.png",
"screenshotHash": "abc123..."
}
GET /api/dashboards/manifest
Returns enhanced manifest with screenshot URLs and metadata.
Response:
{
"dashboards": {
"dashboard-id": {
"title": "Dashboard Title",
"description": "Description",
"tags": ["tag1"],
"screenshotUrl": "/screenshots/dashboard-id.png",
"screenshotHash": "abc123..."
}
},
"metadata": {
"total": 1,
"baseUrl": "http://localhost",
"screenshotBaseUrl": ""
}
}
GET /api/config
Returns current application configuration.
Response:
{
"title": "My Dashboards",
"theme": "light",
"footer": "Hosted Splunk Dashboards",
"screenshots": {
"enabled": false,
"baseUrl": "",
"dir": "screenshots",
"ext": "png"
},
"breadcrumbs": {
"enabled": true,
"showBackButton": true
},
"tabRotation": {
"interval": 15000,
"enabled": true
},
"baseUrl": "http://localhost",
"jwtRequired": false
}
GET /api/data/:dsid
Fetches data for a specific data source.
Parameters:
dsid (path) - Data source IDQuery Parameters:
refresh (optional) - Force refresh cacheResponse:
{
"fields": ["field1", "field2"],
"columns": [
["value1", "value2"],
["value3", "value4"]
],
"meta": {
"sid": "search-job-id",
"status": "done",
"totalCount": 2
}
}
GET /health
Returns server health status.
Response:
{
"status": "healthy",
"timestamp": "2024-01-15T10:30:00Z"
}
GET /api/status
Returns detailed server status and metrics.
Response:
{
"status": "running",
"uptime": 3600,
"memory": {
"used": "45.2 MB",
"total": "512 MB"
},
"cache": {
"entries": 156,
"hitRate": 0.87
}
}
GET /api/splunk/test
Tests connection to Splunk instance.
Response:
{
"connected": true,
"user": "admin",
"url": "https://splunk-instance:8089"
}
GET /api/cache/stats
Returns cache statistics (public endpoint).
Response:
{
"totalEntries": 156,
"memoryUsage": "45.2 MB",
"hitRate": 0.87,
"missRate": 0.13,
"evictions": 23
}
DELETE /api/cache/clear
Clears all cache entries (requires CACHE_MANAGEMENT_KEY).
Headers:
x-cache-key: your-cache-management-key
All endpoints may return error responses:
{
"error": "Error message",
"details": "Detailed error information"
}
Status Codes:
200 - Success400 - Bad Request401 - Unauthorized404 - Not Found500 - Internal Server Error429 - Too Many Requests (rate limited)API endpoints are rate-limited by default:
Configure via environment variables:
RATE_LIMIT_WINDOW_MS=900000 # 15 minutes in milliseconds
RATE_LIMIT_MAX_REQUESTS=1000
curl http://localhost:3000/api/dashboards
curl http://localhost:3000/api/dashboards/my-dashboard/definition
curl http://localhost:3000/api/config | jq .
curl http://localhost:3000/api/splunk/test