Greetings
Here is the scenario I would like to accomplish
I am running the command through the agent on a host to generate an item. the item is system.run[query user |findstr /R "Active"]
The output comes out like this
(Username redacted) rdp-tcp#1 8 Active none 4/20/2021 8:37 AM
(Username redacted) rdp-tcp#2 9 Active none 4/20/2021 10:21 AM
... Continues for other users connected
I would like to reduce this output down to just the username and the session type (rdp-tcp). Active is assumed and not needed along with the date/time, what ever none is can leave also.
So far, preprocessing with regex I have only been able to return just the first user name if using something like \b[^\d\W]+\b inside of regular expression pattern field and output \0 or \1(don't remember exactly)
Using the matches regular expression returns all characters on all lines(very weird)
Thanks for the help
Here is the scenario I would like to accomplish
I am running the command through the agent on a host to generate an item. the item is system.run[query user |findstr /R "Active"]
The output comes out like this
(Username redacted) rdp-tcp#1 8 Active none 4/20/2021 8:37 AM
(Username redacted) rdp-tcp#2 9 Active none 4/20/2021 10:21 AM
... Continues for other users connected
I would like to reduce this output down to just the username and the session type (rdp-tcp). Active is assumed and not needed along with the date/time, what ever none is can leave also.
So far, preprocessing with regex I have only been able to return just the first user name if using something like \b[^\d\W]+\b inside of regular expression pattern field and output \0 or \1(don't remember exactly)
Using the matches regular expression returns all characters on all lines(very weird)
Thanks for the help
Comment