Specifically replacing ELK by Postgres-Kibana.
Requirements for that:
* Events are (timestamp, {arbitrarily nested JSON object})
* Filtering by timestamp must be fast
* Full-text search on the object is required
* Exact constraints on all object keys must be fast
* It should be possible to define indices on the object's fields so that WHERE clauses are fast
* Counting the number of results should be fast, or at least have fast reasonably accurate estimates
* Support typical Kibana searches and filters
I have tried so far to implement Kibana's access patterns on Postgres, and got quite far, but never got past the problem of https://wiki.postgresql.org/wiki/Slow_Counting, which essentially means postgres must scan the whole table if you write a WHERE clause, even when using indices, because it has to double-check whether the returned rows weren't actually deleted.