Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regex case use clarification #2489

Merged
merged 2 commits into from
Feb 14, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/models/agents/trigger_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class TriggerAgent < Agent

The `type` can be one of #{VALID_COMPARISON_TYPES.map { |t| "`#{t}`" }.to_sentence} and compares with the `value`. Note that regex patterns are matched case insensitively. If you want case sensitive matching, prefix your pattern with `(?-i)`.

Where `type` is regex, note that the delimiters are not used and Liquid variables can be used normally. To search for just a word matching the concatenation of `foo` and variable `bar` would use `value` of `foo{{bar}}`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Liquid can be used in every configuration field of the Agent. In theory one could also make a comparison dynamic with {{field_name}}>value, even though I am not sure how useful that would be 😄

To which "delimiters" are you referring to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The leading and trailing delimiters - those coming from other languages would naturally include the leading and trailing / or | to denote a regexp like /foo/ is normal for PHP etc.


The `value` can be a single value or an array of values. In the case of an array, all items must be strings, and if one or more values match, then the rule matches. Note: avoid using `field!=value` with arrays, you should use `not in` instead.

By default, all rules must match for the Agent to trigger. You can switch this so that only one rule must match by
Expand Down