Aggregation for change in text field

Is there an aggregation I can use to note a change of value in a text field in a time series?

Essentially, i have an index which logs a string value of over time. I wish to detect when that value gets changed and return only the results when that value gets changed over time.

There's not a good way at the moment, although there is an open ticket requesting something similar.

I've been thinking about this kind of agg recently and have some ideas, but it's non-trivial since the value changes might be on different shards and not apparent unless all the data is streamed to one location. There are some ways we could work around that but it's not an easy task in a distributed environment