Splunk – Dashboard request optimization

Creating a dashboard in Splunk can be really heavy and long to load if it’s not optimized.

The biggest part of the optimization is the reusage of requests.

To do it easily, Splunk implemented a search object which can be use as basis for other reque…


This content originally appeared on DEV Community and was authored by Maxime Guilbert

Creating a dashboard in Splunk can be really heavy and long to load if it's not optimized.

The biggest part of the optimization is the reusage of requests.

To do it easily, Splunk implemented a search object which can be use as basis for other requests.

<search id="baseSearch">
    <query>$env$ $project$ action=$action$  $typeCode_tok$
    | table timestamp, etransferId, application.name, context, action, correlationId,dd.trace_id, error.code, error.text, log, _raw 
    | sort timestamp $sort$, time $sort$
    </query>
    <earliest>$time.earliest$</earliest>
    <latest>$time.latest$</latest>
</search>

Like this, a big part is already loaded and you just have to refine some elements for a particular graph.

<search id="baseSearch">
    <query>$env$ $project$ action=$action$  $typeCode_tok$
    | table timestamp, etransferId, application.name, context, action, correlationId,dd.trace_id, error.code, error.text, log, _raw 
    </query>
    <earliest>$time.earliest$</earliest>
    <latest>$time.latest$</latest>
  </search>

  <search id="baseSearchLatest" base="baseSearch">
    <query>search 
    | stats latest() by dd.trace_id 
    | rename latest(error.code) AS error.code | fillnull value="emptyVal" error.code
    | rename latest(action) AS action | fillnull value="null" action
    | rename latest(error.text) AS error.text
    </query>
  </search>

I hope it will help you! 🍺


This content originally appeared on DEV Community and was authored by Maxime Guilbert


Print Share Comment Cite Upload Translate Updates
APA

Maxime Guilbert | Sciencx (2022-02-15T14:50:15+00:00) Splunk – Dashboard request optimization. Retrieved from https://www.scien.cx/2022/02/15/splunk-dashboard-request-optimization/

MLA
" » Splunk – Dashboard request optimization." Maxime Guilbert | Sciencx - Tuesday February 15, 2022, https://www.scien.cx/2022/02/15/splunk-dashboard-request-optimization/
HARVARD
Maxime Guilbert | Sciencx Tuesday February 15, 2022 » Splunk – Dashboard request optimization., viewed ,<https://www.scien.cx/2022/02/15/splunk-dashboard-request-optimization/>
VANCOUVER
Maxime Guilbert | Sciencx - » Splunk – Dashboard request optimization. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/02/15/splunk-dashboard-request-optimization/
CHICAGO
" » Splunk – Dashboard request optimization." Maxime Guilbert | Sciencx - Accessed . https://www.scien.cx/2022/02/15/splunk-dashboard-request-optimization/
IEEE
" » Splunk – Dashboard request optimization." Maxime Guilbert | Sciencx [Online]. Available: https://www.scien.cx/2022/02/15/splunk-dashboard-request-optimization/. [Accessed: ]
rf:citation
» Splunk – Dashboard request optimization | Maxime Guilbert | Sciencx | https://www.scien.cx/2022/02/15/splunk-dashboard-request-optimization/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.