This seems to work with a limited set of test data. But it's also late, so it could be way off too 🙂
Essentially, I'm trying split the event by the hashtags, and then expand those sections into separate events. So instead of 1 event above, you'd have 4. And then I rex the serial and bu for each of those new events (so each section of the original 1 event). Then across all events, i do a stats for the largest bu by _raw (even after the expand, all of those new events still have the same _raw).
So now each event has a _raw, serial, bu and the max(bu) that represents the highest bu across the same original event. So finally, I filter on where the max field is the same as the bu field, since those will only match for those events that represent the largest bu per _raw. And that's it, just table the remaining serial and bu fields.
Hopefully that makes sense (and is logically correct)
index=* sourcetype="test:serial"
| eval blah = _raw
| makemv blah delim="#############################"
| mvexpand blah
| rex field=blah "Serial:\s+(?<serial>\S+)[^-]+-(?<bu>.+)"
| eventstats max(bu) as max by _raw
| where max=bu
| table serial bu
... View more