I'm having a problem getting a trigger using regex working as intended.
I have an ssh command that returns a string like so:
I'm trying to setup 6 separate triggers for each word in the sting. For instance, if the first item reads anything other than "OK" then the trigger should be thrown. Same for the 2nd - 6th results. They will always be singe words separated by a space.
I'm using global regular expressions and this is what I have so far to evaluate the first item:
global regex: ^(OK)(\s\w*){6}
named: test1Service
And the following trigger:
(({eRad Template:ssh.run[services].regexp(@test1Service)})#1)
and for my second item:
global regex: ^(\w*\s)(OK)(\s\w*){4}
named: test2Service
And the following trigger:
(({eRad Template:ssh.run[services].regexp(@test2Service)})#1)
But neither are working correctly. Is there a better way to do what I'm trying to accomplish?
I have an ssh command that returns a string like so:
OK OK OK OK OK OK
or
ERROR OK OK OK OK OK
or
ERROR OK OK OK OK OK
I'm trying to setup 6 separate triggers for each word in the sting. For instance, if the first item reads anything other than "OK" then the trigger should be thrown. Same for the 2nd - 6th results. They will always be singe words separated by a space.
I'm using global regular expressions and this is what I have so far to evaluate the first item:
global regex: ^(OK)(\s\w*){6}
named: test1Service
And the following trigger:
(({eRad Template:ssh.run[services].regexp(@test1Service)})#1)
and for my second item:
global regex: ^(\w*\s)(OK)(\s\w*){4}
named: test2Service
And the following trigger:
(({eRad Template:ssh.run[services].regexp(@test2Service)})#1)
But neither are working correctly. Is there a better way to do what I'm trying to accomplish?
Comment