Skip to content

Add ruleset from json #259

Answered by niallnsec
sergerdn asked this question in Q&A
Oct 27, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The problem is that pkg.ParseJSONRuleset expects to be given a rule set rather than just a single rule. A rule set is just a JSON array of rules and it is perfectly fine to only have a single rule as long as it is wrapped in an array.

The Load() function of the JSONResource handles both cases transparently, but if you want to manually load a single GRL JSON rule you can call the function pkg.ParseJSONRule() instead.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sergerdn
Comment options

Answer selected by sergerdn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants