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!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...