As an example ?topic=Deployment:redis would subscribe to all Deployment events for a job redis. an additional topic &topic=Deployment:web would include deployment events for redis and web.
Great. Now what does mean Allocation:redis? Means to subscribe to allocation with ID redis or to allocation that belong to a job named redis? Is it the same with Evaluation:redis? Job:redis? What does it mean to listen to NodePool:redis? ACLToken:redis? What happen when namespace is *, then Job:redis would filter redis job from all namespaces?
Bottom line, what is the exact specification of “filter_key” in event stream?
From your helpful hints, I also see eventMatchesKey() and the above subscription.filter(). I note that eventMatchesKey() matches against Key and against all values in filterKeys and if any of the comparisons is true it returns true.
I’m trying to summarize. This is my understanding, would be great if someone would confirm.
In the Nomad event stream, the parameter filter_key is compared against several fields. Which fields depend on the chosen topic. If any of the comparisons is true, the event is sent. The comparison is done with exact string comparison.
Topic
filter_key is compared with
job
job.ID
alloc
alloc.ID JobID DeploymentID
evaluation
evaluation.ID JobID DeploymentID
nodes
node.ID
deployment
deployment.ID JobID
Etc. someone would have to create a full list with all the topics.