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!

Streamline Data Ingestion With Deployment Server Essentials

REGISTER NOW!Every day the list of sources Admins are responsible for gets bigger and bigger, often making the ...

Remediate Threats Faster and Simplify Investigations With Splunk Enterprise Security ...

REGISTER NOW!Join us for a Tech Talk around our latest release of Splunk Enterprise Security 7.2! We’ll walk ...

Introduction to Splunk AI

WATCH NOWHow are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. ...