Splunk Search

Charting values from performance record

snowmizer
Communicator

I've got a log file that contains, time, controller, and CPU % used. I need to create a time chart that plots the CPU % from the record. I've messed with different timechart and stats functions but nothing pulls the exact CPU % from the record and plots it by time.

What's the best way to do this?

Thanks.

Tags (1)
0 Karma
1 Solution

christopherutz
Path Finder

I suspect what you are not liking is the fact that timechart buckets events and you must supply some aggregator (sum, max, avg) for your field? Have you tried decreasing your span such that you can guarantee there will only be one event per bucket? In this case an average becomes the exact value you are looking for.

my search terms | timechart span=5sec avg(CPU%)

View solution in original post

snowmizer
Communicator

Thanks again for the suggestion.

0 Karma

christopherutz
Path Finder

I suspect what you are not liking is the fact that timechart buckets events and you must supply some aggregator (sum, max, avg) for your field? Have you tried decreasing your span such that you can guarantee there will only be one event per bucket? In this case an average becomes the exact value you are looking for.

my search terms | timechart span=5sec avg(CPU%)

snowmizer
Communicator

Thanks for the suggestion. I forgot that span can be used with timechart.

My data is broken up in 1 minute periods so using the span=1m resulted in too many buckets. I think I'll be fine if I just average the data over 5 minute periods. I think anything less would be too granular anyway. If I want the 1 minute data I can just look at the raw data for that period.

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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