Splunk Search

Is there a way to display a timechart for all results of a search?

azqaz
Engager

I'm trying to find a way to return a list of hosts and then create a timechart of a metric for each of the hosts. Below is the attempt I made using the map command, but only the final result seems to display.

index=nix | dedup host | table host | map [search index=nix sourcetype=cpu  host=$host$ cpu=All| eval pctCPU=(100 - pctIdle) | eventstats avg(pctCPU) as apctCPU, stdev(pctCPU) as sdev | eval threeSigma=(apctCPU + (sdev * 3)) | where pctCPU < threeSigma | timechart span=5m values(pctCPU)]
0 Karma

somesoni2
Revered Legend

How about this

index=nix sourcetype=cpu   cpu=All| eval pctCPU=(100 - pctIdle) | eventstats avg(pctCPU) as apctCPU, stdev(pctCPU) as sdev by host | eval threeSigma=(apctCPU + (sdev * 3)) | where pctCPU < threeSigma | timechart span=5m values(pctCPU) by host
0 Karma

azqaz
Engager

No, that just gives one chart with all of the hosts on it. What I'm needing to satisfy the managers request is a page with one chart for each of the hosts from the fist search results. So if 5 hosts are returned, I need to create 5 graphs.

0 Karma

somesoni2
Revered Legend

You can run this query and in the dashboard->Edit Panel, select the Multi-series as Yes. This will give you one graph for each series (host). See this for more details
https://answers.splunk.com/answers/96358/multi-series-graph-split-by-group-clause.html

0 Karma

azqaz
Engager

That is better. Not exactly what I was hoping for, but probably good enough for the time being. Thanks.

0 Karma
Get Updates on the Splunk Community!

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

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...