Reply

Trigger-Template Match Just Once

Bardlebee
Techie
Posts: 1
1659     0

Hey guys,

 

I'm fairly new to CCS but have some brief history in scripting before.

 

My problem is that I am running a script to match a set of text. Problem is that in the body of the text, the string I'm searching for pops up several times, so my Output-Triggers also react and run several times.

 

############################################################
Trigger:
Detect String

 

Trigger-Description:
In the output, find string just once.

 

Trigger-Template:
...
string .+

 

Trigger-Commands:
SET: $Match = "yes"

 

Output-Triggers:
Output Command

 

############################################################

 

In the case where I have the output the Trigger-Template is running against such as this:

 

different string

string

string

string

different string or no string

 

Or if there is just one line like this:

 

different string

string

different string or no string

 

How do I make it so this Trigger-Template only deploys once for the output? I'm trying to make it so it matches the first instance and doesn't trigger on each one going down.

Re: Trigger-Template Match Just Once

Expert
Posts: 263
1660     0

I don't know how to do what you stated, but will it really matter if the output-triggers are called multiple times, as long as you have them conditionally execute?

 

You already set a variable based on finding the first match:

SET: $Match = "yes"

Output-Trigger:

   Do_Trigger

 

Trigger:

   Do_Trigger

Trigger-Filter:

  $Match ne "yes"

etc.

 

Showing results for 
Search instead for 
Do you mean 

Recommended for You