Splunk Search

Best practice for post-process searches with a timechart base search?

Graham_Hanningt
Builder

I have a Splunk Enterprise 6.4 dashboard that displays multiple timecharts, all based on the same events in the same time range.

When I first developed this dashboard, each chart had its own self-contained search string. I recently edited the dashboard to use the following base search:

<search id="base_timechart">
  <query>sourcetype=my_log_type $blacklist$ $tran$ $response$ | timechart avg(response) sum(usercpu) avg(dispatch) avg(suspend) avg(syncproc) avg(rmielap) avg(fcwait) avg(jcwait) avg(pcstghwm) avg(tdwait)</query>
</search>

(The tokens are set by user interface controls.)

Here is an example chart search in the updated dashboard:

<search base="base_timechart">
  <query>fields _time avg(response)</query>
</search>

That is, I'm using the fields command to pick a series from the results of the timechartin the base search (for some charts, I pick more than one series).

This works for me, but I thought I'd ask (after searching for existing related questions here and Googling for information elsewhere): is this best practice, or is there a better way?

1 Solution

somesoni2
Revered Legend

I'm using fields OR table command in my similar post-process searches. Can't think of any issues or better way than this. Only other thing that I do is the rename columns in the timechart to something user friendly.

View solution in original post

somesoni2
Revered Legend

I'm using fields OR table command in my similar post-process searches. Can't think of any issues or better way than this. Only other thing that I do is the rename columns in the timechart to something user friendly.

Graham_Hanningt
Builder

Thanks, @somesoni2!

Yeah, I rename series in charts that display a legend. For single-series charts, I typically don't bother (renaming or displaying a legend).

If you can convert your comment to an answer, I'm happy to accept it. It's very useful for me to get feedback here on what I'm doing as I'm learning Splunk, especially from someone with high karma points (which I'm roughly equating to "experience"). Thanks again.

ppablo
Retired

Just converted @somesoni2's comment to an answer for you to accept @Graham_Hannington 🙂 cheers!

Patrick

0 Karma

Graham_Hanningt
Builder

Thanks for converting the comment, Patrick 🙂

0 Karma

ppablo
Retired

no problem 🙂

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

A Four-Part Event Series: Full Stack Observability For the AI Era

As AI reshapes applications, infrastructure, and the way teams operate, the traditional boundaries of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...