Dashboards & Visualizations

How do I create a dashboard visualization that is single pane, 4 statuses? : (Stopping, Stopped, Starting, Started)

gaurav_ramteke
Explorer

Hi Guys,

Working on one PoC and week in search commands
After extracting fields i get four search strings as given below for an individual service status

  • index=* sourcetype=* service_status="*Core Stopping"
  • index=* sourcetype=* service_status="*Core Stopped"
  • index=* sourcetype=* service_status="*Core Starting"
  • index=* sourcetype=* service_status="*Core Started"

I want to create a dashboard (visualization of the service status) (Single pane 4 status): (Stopping, Stopped, Starting, Started)

please help

Thanks and Appreciated

0 Karma
1 Solution

efavreau
Motivator

I'm not clear on exactly what you're looking for, but maybe it's one of these two possabilities:
You are looking for the number of times you want to know each service status has occurred. If so, then look at the following run anywhere example that will pull the number of events for some sourcetypes in Splunk's _internal index.

index=_internal sourcetype="*d_access" OR sourcetype="*d_ui_access" OR sourcetype="*k_web_access" earliest="-1m@m" latest="@m"
| stats count BY sourcetype

After running this, go to the Visualization tab, select "Single Value", then click "Trellis" and you would get the count for each sourcetype in one visualization for a single panel in your dashboard.

If you meant you wanted the single value to indicate the current status based on whenever the search was ran, and one of the 4 types of service_status would be shown. Then we can use a case statement to rename the event as we need to match it, and get the last event. This is the most recent status.

index=_internal sourcetype="*d_access" OR sourcetype="*d_ui_access" OR sourcetype="*k_web_access" earliest="-1m@m" latest="@m" 
| eval sourcetype=case(
    sourcetype LIKE "%ui%","UI was the last event",
    sourcetype LIKE "%web%","WEB was the last event",
    sourcetype LIKE "%","splunkd_access was the last event"
    ) 
| stats last(sourcetype)

Then you go to the visualization tab, select "Single Value". You could then use this as a panel, where the status would change based on the timeframe the search was ran.

###

If this reply helps you, an upvote would be appreciated.

View solution in original post

efavreau
Motivator

I'm not clear on exactly what you're looking for, but maybe it's one of these two possabilities:
You are looking for the number of times you want to know each service status has occurred. If so, then look at the following run anywhere example that will pull the number of events for some sourcetypes in Splunk's _internal index.

index=_internal sourcetype="*d_access" OR sourcetype="*d_ui_access" OR sourcetype="*k_web_access" earliest="-1m@m" latest="@m"
| stats count BY sourcetype

After running this, go to the Visualization tab, select "Single Value", then click "Trellis" and you would get the count for each sourcetype in one visualization for a single panel in your dashboard.

If you meant you wanted the single value to indicate the current status based on whenever the search was ran, and one of the 4 types of service_status would be shown. Then we can use a case statement to rename the event as we need to match it, and get the last event. This is the most recent status.

index=_internal sourcetype="*d_access" OR sourcetype="*d_ui_access" OR sourcetype="*k_web_access" earliest="-1m@m" latest="@m" 
| eval sourcetype=case(
    sourcetype LIKE "%ui%","UI was the last event",
    sourcetype LIKE "%web%","WEB was the last event",
    sourcetype LIKE "%","splunkd_access was the last event"
    ) 
| stats last(sourcetype)

Then you go to the visualization tab, select "Single Value". You could then use this as a panel, where the status would change based on the timeframe the search was ran.

###

If this reply helps you, an upvote would be appreciated.

gaurav_ramteke
Explorer

Thank you efavreau

This helped me and its working now its just me to play around the colors
Much Appreciate 🙂

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...