There are two paths I'd recommend:
1) You can send all the events from Open edX to Segment by adding your Segment key to the edX settings. From within Segment, you can specify a destination for this event data to be sent to, which could be a data warehouse like Redshift, Bigquery or Snowflake. Once the events are in the data warehouse, you can query them as you would any other database.
2) You can use xAPI to send the events to a learning record store (LRS). We have a very preliminary edX-to-xAPI bridge that can send events like problem submissions, course enroll/unenroll, course completion, navigation and video events. We've been testing with Learning Locker (an open source LRS), but any xAPI compliant LRS should work.
The LRS is not as easily queryable as a database, but the advantage is that it's specifically designed for tracking learning analytics events, whereas the data warehouse is just a general data store.
If you're interested in learning more about option 1 or 2, let me know and I can send further details.
Nate
--