Splunk Search

How to create over lapping dashboard?

ssharma
Loves-to-Learn Lots

I am new to slunk, I have to create one dashboard and compare current day with same day of last week based on request ids count.

 

 

 

 

 

index="test" s_name="test-app*" earliest=-0d@d latest=now
| bucket span=1h _time
| stats dc(message.req_id) as tcount by _time
| eval ReportKey="today"
| append [search index="test" s_name="test-app*" earliest=-7d@d latest=-6d@d
        | bucket span=1h _time
        | stats dc(message.req_id) as week by _time
        | eval ReportKey="lweek"]
| timechart span=1h sum(week) as Lweek, sum(tcount) as Today by ReportKey

 

 

 

 

 


I want to create over lapping dashboard, like 

ssharma_0-1676285931422.png

Thanks in advance

 

Labels (3)
Tags (2)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @ssharma,

please try something like this:

index="test" cf_app_name="test-app*" ((earliest=-0d@d latest=now) OR (earliest=-7d@d latest=-6d@d))
| eval hour=strftime(_time, "%H"), week=if(now()-_time>86400,"Previous week","This week")
| chart dc(message.req_id) OVER hour BY week

Ciao.

Giuseppe

0 Karma

ssharma
Loves-to-Learn Lots

@gcusello 
Is that possible to  create chart based on _time ??

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @ssharma,

yes it's possible using timechart, but you want to overlap values of today's hours and one week ago, and this is one solution.

Ciao.

Giuseppe

0 Karma

ssharma
Loves-to-Learn Lots

Hi @gcusello 

According to yr solution still I can see till 23 hour of yesterday  in current week day but now its start new day,
can it possible to take current time to last 24 hours ??

ssharma_0-1676296856453.png

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @ssharma ,

let me better understand: what time period do you want to monitor?

I used the time frames of your search, if you want a different time frame put it in the search parameters.

If you want the todays values, you could use:

index="test" cf_app_name="test-app*" ((earliest=@d latest=now) OR (earliest=-7d@d latest=-6d@d))
| eval hour=strftime(_time, "%H"), week=if(now()-_time>86400,"Previous week","This week")
| chart dc(message.req_id) OVER hour BY week

Ciao.

Giuseppe

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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...