########################################
# auto-refresh
########################################
# This macro is being used for the auto-refresh feature within the various dashboards
# By default, the macro checks if the time range selected is a past search, or a search accros incoming data
# If this is a past search, it sets the following:
# For past searches: (auto deactivation of the auto-refresh form)
# is_past_search="true"
# For non past data: (auto activation of the auto-refresh form)
# is_past_search="false"
# If for customization purposes, you want the auto-refresh to be deactivated by default, create a local/macros.conf containing the following version:
# [auto_refresh]
# definition = | stats c | eval is_past_search="true" | fields is_past_search
# iseval = 0
[auto_refresh]
definition = | stats c | addinfo | eval now=now(), delta_now=now-info_max_time, is_past_search=if(delta_now>=14400, "true", "false") | fields is_past_search
iseval = 0
Add following macro code:
Update dashboard with: