Very useful reply, thanks. You obviously pointed out a lot of techniques I never even thought about. You also caused me to study the where command enough to realize I wasn't using it correctly. After I figured that out, I was able to use it to eliminate the commands. Unfortunately it didn't appear that your 'break it up' example correctly sorted by the Time column. But using your technique of prepending the 'Time' string to the 'Command' field had the effect I was looking for. I would still like to understand how to sort by Time in a separate column but this is good enough. Here's the search I landed on:
(index=ise Protocol=Tacacs MESSAGE_CODE=5202) OR (index=acs process="Tacacs-Accounting" MESSAGE_CODE=3300)
| rex field=CmdSet mode=sed "s/^\[(?: )?|CmdAV= ?\]?|CmdArgAV=(?:<cr>)?|(?:<cr>)?\s\]//g"
| where CmdSet!=""
| lookup dnslookup clientip AS Address OUTPUT clienthost AS Device
| eval Device=(if(isnull(Device),Address,Device)), Time=strftime(_time,"%H:%M:%S"), Date=strftime(_time,"%Y-%m-%d")
| where NOT (match(User, "admin1") AND (match(CmdSet, "configure terminal") OR match(CmdSet, "transfer upload")))
| where NOT (match(User, "admin2") AND (match(CmdSet, "switchto (\\\;|vdc)") OR match(CmdSet, "copy.*tftp")))
| eval Command="(".Time.")> ".CmdSet
| stats values(Command) AS Command BY Date,User,Device
Thanks for taking the time to teach me something - this was a really useful exercise!
... View more