Splunk Search

Splunk DB Connect 1: How to improve my dbquery search to speed up my dashboard load time?

crossap
Path Finder

Hi,

I am looking for some help on the best way to speed up my dashboard load time.

Currently, the searches I have enabled on my desktop seem to take a long time to load and makes showing the system frustrating

My Overview Dashboard has 20 traffic lights with each one loading data from dbquery

| dbquery "DATABASE" "SELECT * FROM SANS20Score" | WHERE SANSID = "1.1" | fields "COMPLIANCE%"| rename COMPLIANCE% as SANS1.1 | join [ | dbquery "DATABASE" "SELECT * FROM SANS20Score" | WHERE SANSID = "1.2" | fields "COMPLIANCE%"| rename COMPLIANCE% as SANS1.2] | join [ | dbquery "DATABASE" "SELECT * FROM SANS20Score" | WHERE SANSID = "1.3" | fields "COMPLIANCE%"| rename COMPLIANCE% as SANS1.3] | join [ | dbquery "DATABASE" "SELECT * FROM SANS20Score" | WHERE SANSID = "1.6" | fields "COMPLIANCE%"| rename COMPLIANCE% as SANS1.6] | eval SANS1=('SANS1.1'+'SANS1.2'+'SANS1.3'+'SANS1.6')/4 | fields SANS1 | rangemap field=SANS1 elevated=51-84 low=85-100 severe=0-50 default=none

Is the issue my searches? or can you recommend anything to improve the slow load time.

thanks

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Yes, I think the issue is your searches. Four DB queries are likely to be slow. It would be best to combine them into a single query, but if you can't do that at least reduce the amount of data returned by each one. For example,

| dbquery "DATABASE" "SELECT COMPLIANCE% FROM SANS20Score WHERE SANSID = '1.1'"|  rename COMPLIANCE% as SANS1.1 | join [ | dbquery "DATABASE" "SELECT COMPLIANCE% FROM SANS20Score WHERE SANSID = '1.2'" | rename COMPLIANCE% as SANS1.2] | join [ | dbquery "DATABASE" "SELECT COMPLIANCE% FROM SANS20Score WHERE SANSID = '1.3'" | rename COMPLIANCE% as SANS1.3] | join [ | dbquery "DATABASE" "SELECT COMPLIANCE% FROM SANS20Score WHERE SANSID = '1.6'" | rename COMPLIANCE% as SANS1.6] | eval SANS1=('SANS1.1'+'SANS1.2'+'SANS1.3'+'SANS1.6')/4 | fields SANS1 | rangemap field=SANS1 elevated=51-84 low=85-100 severe=0-50 default=none
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...