Splunk Search

How do you create 2 variables Y axis column chart?

nyasharashad59
Explorer

Hello, I want create a column chart with 2 y-axis variables (AP and FP). I want AP to be the number of bars on the X axis and FP to be the color of bars. For example IF AP is 0 and FP is 0 we have 4 green bars, when AP is 4 and FP is 0 we have 1 green bar. If FP changes, the color of the bars changes. If AP changes the number of bars change .alt text Find attached desired outcome. thanks in advance

0 Karma
1 Solution

DalJeanis
Legend

You just need to make FP your series value, set the colors for each series, and do a stacked bar chart.

I have no idea in the world how you figure your number of bars. An AP value of 0 gets 4 bars, a value of 4 gets 0 bars? Not a clue. Just feed the chart the number of bars you want.

View solution in original post

0 Karma

DalJeanis
Legend

Okay, you'll have to figure out whether you are looking for sum, max, avg, first, last or whatever for the AP and FUP values in any give one hour period, and adjust the stats command accordingly...

index=sandvine sourcetype=sql subscriber_name="$subscriberid$"
| bin _time span=1h
| stats sum(subscriber_ap) as SAP sum(subscriber_fup) as FUP 
| eval chartbars=round(SAP/50)
| eval chartcolor=case(FUP>=150,"orange", FUP>=100,"yellow", true(),"green")
| timechart span=1h max(chartbars) by chartcolor

Then set the chart format to stacked, so that you wont get empty slots for the other two.

You may need some fiddling after that as per this page... http://docs.splunk.com/Documentation/Splunk/6.2.4/Viz/Chartcustomization ... to make green come out green and so on, but the basics are there for you.

0 Karma

DalJeanis
Legend

You just need to make FP your series value, set the colors for each series, and do a stacked bar chart.

I have no idea in the world how you figure your number of bars. An AP value of 0 gets 4 bars, a value of 4 gets 0 bars? Not a clue. Just feed the chart the number of bars you want.

0 Karma

nyasharashad59
Explorer

alt text

0 Karma

nyasharashad59
Explorer

Hello DalJeanis

I have two variables subscriber_ap and subscriber_fup. AP being a scale of 0- 4. FUP being a colour. So lets say you got subscriber_ap on 100 (it should mark on 2 on the y-axis) and subscriber_fup is on 200 it should put the color Red. I have used the commands attached but still no joy!

0 Karma
Get Updates on the Splunk Community!

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...