Another approach would be to rely on the generated file using the JSON format and parse it depending on your needs. To generate the stats in a JSON format, use the following connection configuration "statistics_log=(wait=1,json=true,on_close=true)". You can read more about those options in our
documentation, inside the "statistics_log" section. With this approach, you will need to double-check the generated JSON file. Indeed, WiredTiger will generate multiple JSON sections but WiredTiger does add the JSON array symbols [ ]. It is something I am checking with the team as I think WiredTiger should do this so the generated file is a valid JSON file.
I hope this helps.