I am looking at how to handle a case where rulesets will be applied to
multiple input sources (logical or actual) via jump, but those rulesets
may create and use context names and variables that would conflict
across those input sources.  How I have handled this prior to jump is
with multiple instances of SEC.  This works, of course, but with some
scalability problems depending on the number of partitions needed.  I
hoped to use jump to reduce that scalability problem, but this naming
conflict is not solved by jump.  What I think may be a good solution
would be to add a namespace option to the jump rule:

# somewhat contrived jump rule - logically split input source
type=jump
pattern=^([^-]+)-\S+
namespace=$1
cfset=some-rules

In this case, the examined log line would have <source>-xxx at the start
of each line, so would set the namespace to <source> and jump to
some-rules, which might set variables, contexts, etc., but they would
all be implicitly scoped to <source>:<variable/context name>.  The
namespace would be valid until the next namespace definition is
encountered (i.e., dynamically scoped).  The namespace would have to be
pushed and popped to deal with a jump that includes continue=takenext so
that the previous namespace would be valid after the jump target
finishes processing.  There would probably also need to be a way to
reference the global namespace, similar to $::<var> in Perl, and may as
well allow references to other namespaces, though my primary purpose
here is to hide the idea of namespaces from called rulesets.

Does this seem like way too complex of an idea?  I can make it work as I
have already with distinct instances, or by perhaps by manually setting
up prefixes to variables and contexts similar to this.  It's just that
it would be complicated and error-prone, and as soon as I thought of
doing that, it occurred to me that a namespace solution would be much
more elegant and robust.  Thoughts?  I'm sure I'm forgetting something
that would make this horribly problematic.

Thanks,
Mark

-- 
Mark D. Nagel, CCIE #3177 <mna...@willingminds.com>
Principal Consultant, Willing Minds LLC (http://www.willingminds.com)
cell: 949-279-5817, desk: 714-495-4001, fax: 949-623-9854

*** Please send support requests to supp...@willingminds.com! *** 


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Simple-evcorr-users mailing list
Simple-evcorr-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to