I have a JMS feed that provides messages with the following JSON structure:
{ String:currentSessions, Long:duration, Long:rows, Long:fill, Long:execute, String:source, String:category, String:url, String:hostname }
What I would like to do is a define a stream similar to the following that would provide a moving average by hostname via a rich-gauge:
stream create duration_gauge --definition "tap:stream:interceptor > object-to-json | transform --expression=#jsonPath(payload,'$.duration') | rich-gauge --nameExpression=#jsonPath(payload,'$.hostname')" --deploy
Obviously, this does not work as the payload has already been transformed and no longer includes the hostname field.
Questions:
- Is there a way to save part of the payload between pipes? I've read about custom headers, but I don't see a documented way to create and access them.
- It seems that the only way to accomplish I would like to do is create a stream/rich-gauge per hostname. Is that the best solution?
Thanks!