我有一个 python 脚本,它以 json 形式获取集群运行状况并向我发送邮件。问题是 json 没有很好地打印出来。这些是我已经尝试过的方法:
但是gmail中的输出还是没有格式化的,有点像这样
{ "active_primary_shards": 25, "active_shards": 50, "active_shards_percent_as_number": 100.0, "cluster_name": "number_of_pending_tasks": 0, "relocating_shards": 0, "status": "green", "task_max_waiting_in_queue_millis": 0, "timed_out": false, "unassigned_shards": 0 }
邮件已发送至 gmail