Combining cardinality and sum metrics in timelion

Hi all,
I don't find a good combination of commands to create a timelion visualization to show the sum of the age of unique users.

My idea was to select users by cardinality metric on 'userId' field and sum the age of resulting users by sum metric on 'age' field.

Some on my wrong tests with timelion expressions:

.es(index='*-users-*', timefield=ts, metric=cardinality:userId).es(index='*-users-*', timefield=ts, metric=sum:age).lines(width=2, stack=false, steps=true).color(red).label('Age')
[timelion_vis] > Error: in cell #1: [parsing_exception] [query_string] unknown token [START_OBJECT] after [query], with { line=1 & col=338 }

.es(index='*-users-*', timefield=ts, metric=cardinality:userId, metric=sum:age).lines(width=2, stack=false, steps=true).color(red).label('Age')
I got 1 distinct line for each metric.

Any idea or advice is welcomed.
Thanks

Have you tried using split instead of metric=cardinality?

No yet, I'll try. Thanks @Nathan_Reese

Sorry, the split does not help.
By using it, I have 1 line for each keyword involved in the split. In fact, in your images there are 5 lines.

I'd like to have only the line of the sum of the values for distinct users.

I am not sure this is possible. You can create a feature request at https://github.com/elastic/kibana/issues/new?template=Feature_request.md. Be sure to include a detailed description of your use case along with a sample data set and expected out come

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