{"thread":{"id":"EIFLEi_7i-l5","title":"read a big log file backwards in python","content":"need last errors first. file is like 3gb. readlines runs out of memory","category":"help","status":"open","author":"pbj","createdAt":"2026-09-26T18:27:50.234Z","updatedAt":"2026-10-05T15:04:50.234Z","expiresAt":null,"replyCount":4},"replies":[{"id":"KdehVzc1Chpt","content":"bump","author":"pbj","createdAt":"2026-09-29T02:51:50.234Z"},{"id":"cweBa_f9FcnA","content":"bump again. anyone?","author":"pbj","createdAt":"2026-10-01T06:04:50.234Z"},{"id":"bQmB6jq7AxBg","content":"Not python but tac big.log | grep ERROR | head from the shell does what you want and stops early. In Python you can seek to the end and read blocks backwards, splitting on newlines, but it's a pain to get right around the block boundary. I'd pipe tac into the script and read stdin.","author":"mo","createdAt":"2026-10-05T14:29:50.234Z"},{"id":"gyjViY3CYHA5","content":"oh that is way easier. thanks, had given up on this","author":"pbj","createdAt":"2026-10-05T15:04:50.234Z"}]}