Splunk Search

Box plot error in 'stats' command

Questioner
Path Finder

I try to make box plot graph using <viz>

However, My code have this error,

"Error in 'stats' command: The number of wildcards between field specifier '*' and rename specifier 'lowerquartile' do not match. Note: empty field specifiers implies all fields, e.g. sum() == sum(*)"

and My code is this

<viz type="viz_boxplot_app.boxplot">
<search>
<query>index=idx_prd_analysis sourcetype="type:prd_analysis:result" corp="AUS"
| eval total_time = End_time - Start_time
| stats median, min, max, p25 AS lowerquartile, p75 AS upperquartile by total_time
| eval iqr=upperquartile-lowerquartile
| eval lowerwhisker=median-(1.5*iqr)
| eval upperwhisker=median+(1.5*iqr)
</query>
<earliest>$earliest$</earliest>
<latest>$latest$</latest>
</search>
<option name="drilldown">all</option>
<option name="refresh.display">progressbar</option>
</viz>

 I don't use any "eval" or string words at the "stats", But it happend.
How could I solve this problem? 

 

Labels (2)
Tags (1)
0 Karma
1 Solution

dtburrows3
Builder

You may need to specify the "total_time" field as the field to return descriptive statistic on instead of using it as a by-field in this search.

Something like this,

index=idx_prd_analysis sourcetype="type:prd_analysis:result" corp="AUS"
    | eval
        total_time='End_time'-'Start_time'
    | stats
        median(total_time) as median,
        min(total_time) as min,
        max(total_time) as max,
        p25(total_time) as lowerquartile,
        p75(total_time) as upperquartile
    | eval
        iqr='upperquartile'-'lowerquartile',
        scalar=1.5,
        lowerwhisker='median'-('scalar'*'iqr'),
        upperwhisker='median'+('scalar'*'iqr')

 

View solution in original post

0 Karma

dtburrows3
Builder

You may need to specify the "total_time" field as the field to return descriptive statistic on instead of using it as a by-field in this search.

Something like this,

index=idx_prd_analysis sourcetype="type:prd_analysis:result" corp="AUS"
    | eval
        total_time='End_time'-'Start_time'
    | stats
        median(total_time) as median,
        min(total_time) as min,
        max(total_time) as max,
        p25(total_time) as lowerquartile,
        p75(total_time) as upperquartile
    | eval
        iqr='upperquartile'-'lowerquartile',
        scalar=1.5,
        lowerwhisker='median'-('scalar'*'iqr'),
        upperwhisker='median'+('scalar'*'iqr')

 

0 Karma

Questioner
Path Finder

@dtburrows3 
Thank you for your help.
It work!

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

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