Log and history export

Hi, I need to do some troubleshooting on many sensors to test why a couple of automations do not execute as designed and I need to check logs via third-party apps (e.g. xls or similar), how can I export logs and sensor history to a more handleble format?