Regexp. Select second value from list

238 Views Asked by At

I create trigger in Zabbix -

"Event Log - User Account Changed ({{ITEM.VALUE}.iregsub("Account Name:\s*([\w- ]*)", "\1")} change {{ITEM.VALUE}.iregsub("Account Name:\s*([\w- ]*)", "\1")})"

I get:

"Event Log - User Account Changed (Admin_Name change Admin_Name)", 

But i want to get:

"Event Log - User Account Changed (Admin_Name change User_Name)"

I want to select the second value from the list. I can not understand how to do this?

Help, please.

enter image description here

1

There are 1 best solutions below

0
On

I found a solution, I do not know how much this is correct, but it works ...

Target Account:\s+.+\s+Account Name:\s*([\w- ]*)

As a result, the name of the triger looks like this:

Event Log - User Account Changed (DOMAIN\{{ITEM.VALUE}.iregsub("Account Name:\s*([\w- ]*)", "\1")} change DOMAIN\{{ITEM.VALUE}.iregsub("Target Account:\s+.+\s+Account Name:\s*([\w- ]*)", "\1")})

My problem is solved. Thanks to all! )