Can logstash lookup an ID from ingested logs and replace it with its corresponding data from a database table?

as above. can logstash do this kind of relational database FK=PK kind of thing?

A jdbc_static or jdbc_streaming filter might do what you want.