Unable to get proper sort result with 1 Subbucket


(Jmisc Li) #1

Hi,
I am new to Kibana 6.5.1 and wonder if someone can help. I'm not sure if this is currently supported. I'm trying to create a line graph with data plot based on count and date with grouping of Account type.
Y-Axis: count
X-Axis: Terms with run_date order by Alphabetical
It works fine. Date is sorted properly.
Next step, I added a sub-bucket using the account_type field.
Sub Aggregation: Terms
Field: account_type
The X-Axis field is not sorted properly. Date field (in integer - Julian date) is no longer in ascending order.
Is it possible to disable the sorting of the Sub Aggregation section or fix the X-Axis sorting?

I add a Date field to use an actual date (converted from Julian date) and changed the X-Axis to use Date histogram. The order seems to be good now.

Is there a way to force integer sort order as I notice there is an Advanced Setting with sort option?

Thank you


(Joe Fleming) #2

If your x-axis is using a Terms agg, it only lets you order by some metric (either one you're displaying, or a custom one) or alphabetically. Since you want to sort alphabetically, this is fine in your use case. I attempted this locally with some sample data, and it works as expected, ordering alphabetically ascending and descending.

When I add another bucket, I get the same order on the X-Axis though, but it sounds like you don't. Is it possible for you to share a screenshot or details about all of your metric and bucket configuration? Here's mine:

I wonder if the "size" setting on the date field might be causing you issues, and maybe the results aren't what you expect them to be.


(Jmisc Li) #3

Hi,
Thank you for your reply. Below is the graph I have.


The Julian date 2018297 should be in the middle but it is not.

Y-Axis:
Aggregation: Max
Field : duration

If I filtered out one of the job_id, it's sorted properly. It looks like if a sub-bucket is added, it changed the sorting result.

Thank you,
Helen