Splunk Search

Creating a line graph based on two different medians

wajeeh911
Engager

I have a table below in splunk. I'm trying the create a line graph which would graph four lines. The X axis would be the bypass value. The Y axis would be the the 50th percentile and 80th percentile of Type3 and and the 50th and 80th percentile of Type4. But there doesn't seem to be a way to do a stats, eval, if statement. 

Labels (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

@wajeeh911 

See this example - it first creates a similar data sample set to your data then just uses the chart statement to do what you describe.

| makeresults 
| eval n=mvrange(1,31)
| mvexpand n
| eval Type="Type".(random() % 2 + 3)
| eval Bypass="S".(random() % 3 + 37)
| eval TotalTime=random() % 15 + (random() / 100000)
| table TotalTime Bypass Type
| chart perc50(TotalTime) as p50 perc80(TotalTime) as p80 over Bypass by Type

Hope this helps

 

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...