Splunk Search

timechart linechart to display in and out per device

surekhasplunk
Communicator

Hi,

I have a query which gives me in_usage and out_usage for a device per metric

bla bla ...| table Device metric_name "in_usage%" "out_usage%"  

Now i want to display the top20 in_usage in one line in the line chart graph and out_usage in another line in the same graph by Device and metric_name.

How to do that am little confused.

I tried using below at the end but i dont want to explicitly sort it by out it should be sorted by both in/out

| stats values("in_usage%") as IN_usage values("out_usage%") as OUT_usage by Device metric_name | sort - OUT_usage |head 20

Please help

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The sort command can sort on more than one field. For example, sort 0 -OUT_usage, IN_usage.

---
If this reply helps you, Karma would be appreciated.
0 Karma

surekhasplunk
Communicator

I tried to sort as you suggested but not working for my case.

if i write like this sort 0 -OUT_usage, IN_usage ----> OUT_usage gets sorted in decending
if i write like this sort 0 -IN_usage, OUT_usage ----> IN_usage gets sorted in decending.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

That is the way sort works. It's rather like sorting in Excel. Sort by one column and when there are duplicates in that column, sort by the other column.
How exactly do you want your data sorted? Examples?

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Optimize Cloud Monitoring

  TECH TALKS Optimize Cloud Monitoring Tuesday, August 13, 2024  |  11:00AM–12:00PM PST   Register to ...

What's New in Splunk Cloud Platform 9.2.2403?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.2.2403! Analysts can ...

Stay Connected: Your Guide to July and August Tech Talks, Office Hours, and Webinars!

Dive into our sizzling summer lineup for July and August Community Office Hours and Tech Talks. Scroll down to ...