Splunk Search

Chart with multiple Row Fields that Share Values Over One Column Field

jjezusek
Engager

Hello,
I was wondering if you can have a chart that compares the average of one field depending on the value of several other fields. I want to compare the average runtime of a query and compare the time depending on how many certain conditions are set. So for example I want to see the difference of having 1 integer condition compared to 1 varchar condition as a side by side bar chart. The two charts I have that show the results are below:

| chart avg(runtime) as "Average Run Time(ms)" by Total.Count.Integer.Conditons

| chart avg(runtime) as "Average Run Time(ms)" by Total.Count.Varchar.Conditons

alt text

So the above two charts would ideally be one grouped by the number of conditions.

Thanks!

Tags (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Give this a try

your current search before the chart command which has fields runtime  Total.Count.Integer.Conditons Total.Count.Varchar.Conditons
| untable runtime condition TotalCount
| eval IntRuntime=if(condition="Total.Count.Integer.Conditons",runtime, null())
| eval VarRuntime=if(condition="Total.Count.Varchar.Conditons",runtime, null())
| stats avg(IntRuntime) as "Average Run Time(ms) - Integer Condition"  avg(VarRuntime) as "Average Run Time(ms) - Varchar Condition" by TotalCount

View solution in original post

somesoni2
Revered Legend

Give this a try

your current search before the chart command which has fields runtime  Total.Count.Integer.Conditons Total.Count.Varchar.Conditons
| untable runtime condition TotalCount
| eval IntRuntime=if(condition="Total.Count.Integer.Conditons",runtime, null())
| eval VarRuntime=if(condition="Total.Count.Varchar.Conditons",runtime, null())
| stats avg(IntRuntime) as "Average Run Time(ms) - Integer Condition"  avg(VarRuntime) as "Average Run Time(ms) - Varchar Condition" by TotalCount

jjezusek
Engager

Thank you. This was able to work!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...