last two bits
A) have a look at the formal documentation for how CT servers should operate (it may give you a better idea of how to modify the scripts - for example what the log formats are). https://tools.ietf.org/html/rfc6962
B) Another example of how to use SQL to query CT databases and retrieve data: Adjustments to the Let's Encrypt Statistics methodology
Andrei