Need program variables from config file

I'm using logstash as output method for packetbeat and I want to filter transactions in logstash, for example, I received 3 packets described as below

packet A is from to
packet B is from to
packet C is from to

now I need logstash only output packet C, what i'm thinking now is to maintain a whitelist read from some config file in logstash, any packet compliant with this list will output and others won't.

Does logstash have this kind of feature ? or any workaround I can take ?
thanks a lot !

I don't know if there is a way to do this, packetbeat stores hostnames rather than IPs for the most part. It does store a client_ip though, so maybe you can use that?

thanks for the reply, finally I figured out a way using a new experimental feature in the latest version 2.3.2 to workaround this, the new feature allows logstash to read system environment variables, after that I use mutate to add a new field contains the desired content, then I can do filter efforts in ruby code.

This sounds like a good task for the translate filter.

oh god that seems exactly what i need by reading the translate document page, many thanks !!!