Does Logstash have any way of knowing what it's pid is?

I'm trying to setup some lightweight healthchecks for my system for Logstash to get us by until 5.0 is prod ready and we can adopt it.

My implementation is to use the heartbeat input plugin to generate some basic info about the time of the heartbeat and write it to a local redis instance. Then a 2nd job would gather the info in Redis periodically and create a simple html page with a json formatted string showing the info.

Since i run collectors in many different app servers, it would be nice to be able to have each collector send it's heartbeat info to the Redis instance using a unique key that would be dynamically composed of it's hostname (already available in the heartbeat mesage) and some other unique ID (in case I have multiple logstash processes on the same host. I was thinking the PID).

The question: Does logstash have any way of knows what it's own PID is?
**or...**Does logstash have any way of dynamically generating any other unique piece of information like that without me having to hardcode it into a new field with the add_field param?

You could use a ruby filter to obtain the process's PID.