问题
I have three fields in my data: tran_date
, use_case
, Amount
.
use_case
field having multiple values i.e. B2B, cash_in, C2C etc.
I want to plot a bar chart by sum up Amount
field against use_case
(B2B, cash_in only) then want to group data on yearly basis . so there will be a bar for each year summing up the Amount
against use case B2B, cash_in.
I explored filter and sub-buckets but they don't seem to provide grouping of values.
回答1:
"sub buckets" create aggregations, which are groupings. Setup your x-axis as a Date Histogram on @timestamp, then add a sub-bucket using Terms for use_case. To get the sum, edit the y-axis (metrics).
来源:https://stackoverflow.com/questions/35764519/kibana-filter-data-on-the-basis-of-one-field-and-then-grouping-values-on-basis