I've done a similar thing years ago using built in HLDS features: logaddress and rcon.
If you issue this command to the server (via config or console)
logaddress <ip> <port>The server will start sending its logs to the IP and port you specified, logs come in as UDP packets so you will need some sort of listener ready to go.
e.g. https://npm.io/package/hlds-log
The core of all the HLDS log readers is the regex used to parse the logs, so essentially you can use any language you like.
RCON can be used to send/receive commands from the server (to kick someone, change map etc...)
Something like https://www.npmjs.com/package/rcon though plenty of different implementations exist.
If you have custom features they have to log output to the server console for this method to work.