Average number of fields per another field

I have two fields in elastic search document, item_id, package_id, and creation_time. They are in a one to may relationship ( 1 item_id -> many package_id)

I want to display the (number of unique package_id/ unique number of item_id) in buckets based on creation_time.

Is this possible in kibana (version 5.5.1)? I am able to get the unique count of item_id and unique count of package_id and split them into buckets. I have no idea how to divide them (items/packages). Please help.

Sounds like the easiest thing here might be to create a scripted field that combines them, then do a unique count based on that.

Something like:

doc['item_id.raw'].value + '|' + doc['package_id.raw'].value

Created a scripted filed like you mentioned. But it is not visible in the drop down of Time series builder when I select cardinality.
Is this because item_id is a integer and package_id is a string?

Hi, we recently released a Kibana plugin that should do the job. Check it out there https://github.com/datasweet-fr/kibana-datasweet-formula

Compatible with 5.6 and upward.

Ahh, unfortunately TSVB doesn't support scripted fields :frowning:

Could you index this field instead?

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