Dashboards & Visualizations

Weekly Trend for a moth and Monthly trend for last 6 months

pavithra
Explorer

I want to show weekly data in a trend ,it should not add total 

Right now using the below query, but it showing overall count of a week

| timechart span=1w@w7 sum(abc) by xyz

@splunk 

Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

By "weekly data" data, do you mean daily data for the week? If so, you need to timechart by day and set your time period to be the week

| timechart span=1d sum(abc) by xyz

 

pavithra
Explorer

I want to show data for every monday on weekly basis

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

| timechart span=1d sum(abc) by xyz
| where strftime(_time,"%w") = 1

pavithra
Explorer

Its throwing an error 

pavithra_0-1716213361173.png

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Sometimes Splunk is forgiving when it comes to data types, sometimes it isn't - this is one of those!

| timechart span=1d sum(abc) by xyz
| where strftime(_time,"%w") = "1"
0 Karma

pavithra
Explorer

still its not working

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Please share the failing SPL

0 Karma

pavithra
Explorer

Thanks for your response!
I got the query

I index 
| timechart span=1d sum(abc) as total by xyz
| eval day=lower(strftime(_time,"%A"))
| where day=="monday"
| fields - day

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Interesting that you didn't do exactly as I suggested, but this should also work. What exactly is not working?

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 ...