Parse output of elasticsearch-py commands

I am writing on alerting functionality in Python using elasticsearch-py client. https://github.com/elastic/elasticserch-py. CatClient class has methods that I am interested in. I can see the output as stdout when I run my python code, however I want to parse the output and extract some details that I want. How do I do it? Is there any parameters that I can pass to get the output as list or json?

try format=json for the cat API. However you could also use the dedicated JSON APIs depending what data you are after.

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