Query database from a filter

I'm just new to Elasticsearch, and I'm looking to find a way to get info from a database, based on a value stored in an index tab. I've looked at the jdbc input plugin, however I'd like to do it within a condition in a filter. Do I need to create a separate python script, or can it be done within Logstash?

Any help would be greatly appreciated.

Perhaps you can use the translate filter to look up values against a static file (that could be generated periodically from a database)?

That sounds like a great idea, but I just want to make sure I understand. Should I query the database separately, outside of logstash, create a file, then just 'query' the file via translate?

Yes, exactly.

Great, thanks!