Dashboards & Visualizations

SPL search: How to showcase graph only with values?

uagraw01
Builder

 

Hello Splunkers!!

As pe the attached screenshot I want to hide values from sep 2022 to july 2023, because those period have a null values. So I want to showcase graph only with values.

uagraw01_0-1694424038559.png

 

Labels (1)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You have two issues here - firstly timechart fills in the blanks so even if there isn't any data for the middle days, you will still get zero counts - secondly the chart viz will create a timeline based on _time (whether there is data in the results table or not)

To solve this, firstly, you need to use bin and chart, and secondly you need to create a string field for the time

| bin _time span=1d 
| chart <your aggregate function> by _time LiftState
| eval time=strftime(_time, "%F")
| fields time *
| fields - _time

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

You have two issues here - firstly timechart fills in the blanks so even if there isn't any data for the middle days, you will still get zero counts - secondly the chart viz will create a timeline based on _time (whether there is data in the results table or not)

To solve this, firstly, you need to use bin and chart, and secondly you need to create a string field for the time

| bin _time span=1d 
| chart <your aggregate function> by _time LiftState
| eval time=strftime(_time, "%F")
| fields time *
| fields - _time

uagraw01
Builder

@ITWhisperer You are a genius.

richgalloway
SplunkTrust
SplunkTrust

Change the time range of the search to start in July 2023.  That may be within the lift_activity_marco_1d macro.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...