Unique count metric from two fields


how can I do unique count based on two fields? I have only two separate unique counts now, but that’s not the thing what i need. Let’s imagine from_user and to_user are telephone numbers and I need unique count of users. Thanks a lot!

Not sure Elasticsearch supports this. Maybe with a scripted pipeline metric?

I have asked this question in Elastic forum and I got this answer:

So, it is possible with scripted pipeline, but in Grafana is no possibility to add script for unique count (cardinality) metric