Elasticsearch-py: query a unique count

Hello,

I am using elasticsearch-py for a project. Currently I have a filter that needs to be translated into python code.

system.process.name:my_process && system.process.cmdline:special_flag

In Kibana, I have this filter saved. I then use this filter in a visualization to perform a unique count on the host field for me.

I was wondering how I could convert this into an elasticsearch-py call.

So far I have

es.count(index='metricbeat', q='system.process.name:my_process && system.process.cmdline:special_flag')

But I still need that unique count of host.

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