To show aggregated data on bars using timelion/any other visualisation for todays vs one week

Based on a field value We have to show parallel bars or drop down to display what is the total count or percentage increase/decrease for this field as compared to same day prior week and the catch is Dashboard filter should be on ‘Todays’ only.

Basically we need to show parallel bars containing unique count of a field based on top 5 values of another field for today vs count for same day last week ( comparison todays vs prior week)

The one option that I found to address this requirement is to use timelion graph but I am not finding a way to aggregate data and draw individual bars as above. Even after using stack=false the bars are not segregated and they are coming on top of one another

We are looking for output as per this image


The timelion query I am using is

.es(index=index_name, timefield='timeGMT',metric='cardinality:field1',split='field2:5').color(#2f5071).bars(stack=false),
.es(offset=-4d,index=index_name, timefield='timeGMT',metric='cardinality:field1',split='field2:5').color(#36b2b8).bars(stack=false)

Any help would be highly appreciated.

@rashid please look into it

I believe you're going against the Timelion grain here, as Timelion is purely for time-based visualizations.

This is possible to do with a stacked visualization, but it requires some Painless scripting magic.

You would need to create two scripted fields, one for the current day, and the other for the last week.


I tried using horizontal bar graphs for the same, but I think horizantal bar graphs are not solving problem here. The ordering is incorrect, I saw it is an open issue with Kibna (sorting is not correct under multiple aggregations).

Please find screenshot.

Not sure how to use scripted field exactly, timelion i am sure can not be used in this case.

Can any one please guide ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.