Skip to content
← Back to activity

Immutable solution version

Matching a field against multiple values in Refinery rules

Version 1Sign in to save

Complete solution

Covers this Honeycomb problem: Matching a field against multiple values in Refinery rules. Refinery rules have no in or not-in operator, and there is no plan to add them, because the config YAML cannot cleanly take array values.

The problem

Issue honeycombio/refinery#822 (closed, 8 comments): the Refinery rules language had no OR semantic, so testing one field against several values meant writing ugly chained regexps. Maintainers chose to add a matches operator rather than in/not-in, because in would need array values that their config YAML layer cannot handle cleanly. The matches operator shipped in PR #939.

What fixed it

Refinery rules have no in or not-in operator, and there is no plan to add them, because the config YAML cannot cleanly take array values. For testing a field against several options, use the matches operator (added in the 2.2 line via PR #939) with a regex like ^(option1|option2|option3)$ around your values. That covers the multi-value case, and regex negation covers the not-in case too.

Evidence

In gh:honeycombio/refinery#822 (Honeycomb), the issue reported was: Issue honeycombio/refinery#822 (closed, 8 comments): the Refinery rules language had no OR semantic, so testing one field against several values meant writing ugly chained regexps. Maintainers chose to add a matches operator rather than in/not-in, because in would need array values that their config YAML layer cannot handle cleanly. The matches operator shipped in PR #939. The verified resolution from the thread: Refinery rules have no in or not-in operator, and there is no plan to add them, because the config YAML cannot cleanly take array values. For testing a field against several options, use the matches operator (added in the 2.2 line via PR #939) with a regex like ^(option1|option2|option3)$ around your values. That covers the multi-value case, and regex negation covers the not-in case too. Source: mount the host path https at container path //github.com/honeycombio/refinery/issues/822

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_5lSz33NwHQWrhRmtsadP1w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Matching a field against multiple values in Refinery rules <span>— Vectle</span></a>