Configure search refresh intervals

You can configure your data source with a search refresh interval to refresh associated visualizations automatically at the specified interval. In this example, the refresh type is configured as Delay with an interval of 10 minutes, meaning that after the search is done, a 10-minute interval occurs, then the search automatically refreshes.

Search refresh interval configured to a 10-minute delay.

Don't specify default intervals of time that are too short in dashboards with many visualizations. Examples that use a refresh interval of under 1 minute are only appropriate for simple dashboards with few visualizations. Any interval less than 1 minute might not give the search jobs enough time to run, or may have a heavy performance impact on your dashboard. You can specify a string with the interval, such as "1m" for 1 minute. If you just specify an integer, without a time unit, the default unit is seconds.

Note: A user without the auto_refresh_dashboards capability can configure a search refresh interval, but auto refresh is deactivated when they view a dashboard. When a user without the auto_refresh_dashboards capability views a dashboard, searches run on initial load and on manual refreshes. Searches do not auto refresh per their configured refresh schedule. See Controlling access to auto-refresh searches
Note: Specifying these settings for a datasource overrides any refresh and refreshType setting in the defaults section of the dashboard definition.
JSON
"dataSources": {
        "ds_search_1": {
            "name": "Search",
            "options": {
                "query": "index=_internal | top limit=100 sourcetype | eval percent = round(percent,2)",
                "queryParameters": {
                    "earliest": "$TimeRange.earliest$",
                    "latest": "$TimeRange.latest$"
                },
                "refresh": "10s",
                "refreshType": "delay"
            },
            "type": "ds.search"
        }
    },

Expand this box to see the complete dashboard definition. You can copy/paste it into your own instance.

JSON
{
    "title": "Time Picker Input Example",
    "description": "Add a time range picker to modify a search time span.",
    "inputs": {
        "input_1": {
            "options": {
                "defaultValue": "-24h,now",
                "token": "TimeRange"
            },
            "title": "Select a time:",
            "type": "input.timerange"
        }
    },
    "visualizations": {
        "viz_chart1": {
            "dataSources": {
                "primary": "ds_search_1"
            },
            "description": "Chart of Top Sourcetypes between $TimeRange.earliest$ and $TimeRange.latest$",
            "options": {},
            "showLastUpdated": true,
            "showProgressBar": true,
            "type": "splunk.pie"
        }
    },
    "dataSources": {
        "ds_search_1": {
            "name": "Search",
            "options": {
                "query": "index=_internal | top limit=100 sourcetype | eval percent = round(percent,2)",
                "queryParameters": {
                    "earliest": "$TimeRange.earliest$",
                    "latest": "$TimeRange.latest$"
                },
                "refresh": "10m",
                "refreshType": "delay"
            },
            "type": "ds.search"
        }
    },
    "layout": {
        "globalInputs": [
            "input_1"
        ],
        "layoutDefinitions": {
            "layout_1": {
                "options": {
                    "display": "auto-scale",
                    "height": 1250,
                    "width": 1200
                },
                "structure": [
                    {
                        "item": "viz_chart1",
                        "position": {
                            "h": 530,
                            "w": 680,
                            "x": 250,
                            "y": 80
                        },
                        "type": "block"
                    }
                ],
                "type": "absolute"
            }
        },
        "options": {
            "submitButton": false
        },
        "tabs": {
            "items": [
                {
                    "label": "New tab",
                    "layoutId": "layout_1"
                }
            ]
        }
    }
}