All Apps and Add-ons

How to build max and sum in two timecharts per day

tgdvopab
Path Finder

Hello

I want to use two timecharts:
1st to build the max value per day, Database
2nd to build to sum of the first values from the timechart per day

The code looks like the following:

index=msexchange eventtype=msexchange-database-stats | timechart span=1d max(FileSize) as maxDBSizeperday by Database | timechart span=1d sum(maxDBSizeperday)

This doesn't work.
Could anyone help me?

0 Karma
1 Solution

jkat54
SplunkTrust
SplunkTrust

See if this works:

index=msexchange eventtype=msexchange-database-stats 
| bin span=1d
| stats max(FileSize) as maxDBSizeperday by Database , _time
| stats values(maxDBSizeperday) sum(maxDBSizeperday) by Database, _time

It should produce a statistics table that you can then take to the visualization tab and it will look just like a timechart if you select a line chart etc.

View solution in original post

sundareshr
Legend

Try this

index=msexchange eventtype=msexchange-database-stats | timechart span=1d max(FileSize) as maxDBSizeperday by Database | addtotals | table _time Total
0 Karma

jkat54
SplunkTrust
SplunkTrust

See if this works:

index=msexchange eventtype=msexchange-database-stats 
| bin span=1d
| stats max(FileSize) as maxDBSizeperday by Database , _time
| stats values(maxDBSizeperday) sum(maxDBSizeperday) by Database, _time

It should produce a statistics table that you can then take to the visualization tab and it will look just like a timechart if you select a line chart etc.

Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...