Take a look at Coroot [0], which stores logs in ClickHouse with configurable TTL. Its agent can discover container logs and extract repeated patterns from logs [1].
[0] https://github.com/coroot/coroot
[1] demo: https://community-demo.coroot.com/p/qcih204s/app/default:Dep...