how many patterns do you have? if it's no many, you can just use eval command with case/match functions.
... | eval my_val = case(match(_raw,"aaa\s+:\d\d:"),2,match(_raw,"aaa\s+:\d:"),1,true(),"n/a")
If you have a lot that might be a bit more difficult. Splunk does not have a regex match built into the lookup functionality - only wildcard and cidr.
And being new to Splunk, you'll have to rework your brain a bit from programming to puzzle solving. In general (but not exactly always true), when you pipe your search results to a new command, splunk loops through all of the events - that's your outer loop. And so you need to munge your results through one or commands/pipes until it's the way you want it - in this case we're using eval to create a new field on each iteration
... View more