[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Logs-devel] LoGS userfriendliness?
From: |
Vijay Lakshminarayanan |
Subject: |
[Logs-devel] LoGS userfriendliness? |
Date: |
Tue, 2 May 2006 03:35:18 -0500 |
Hi Jim
Here's my idea, not fully worked out and I have to come up with a
proper grammar for it but you'll get the idea.
Also, since speed is the key, it's better we directly implement the
macro rather than have it generated.
(LoGS with messages from file filename
with rule matching "message" and length > 10
with rule matching regexp "^.*success\\." and rule matching "user"
do magic)
would generate
(with-open-file (#:messages filename)
(let ((#:rule1 (make-instance 'rule :match (lambda (#:msg)
(string= (message #:msg)
"message")))n)
(#:rule2 (make-instance 'rule
:match (lambda (#:msg2)
(cl-ppcre::scan "^.*success\\."
(message #:msg2)))
:action (make-instance 'rule
:match (lambda (#:msg3)
(string= #:msg3
"user")))))
((#:ruleset (make-instance 'ruleset))))
(enqueue #:ruleset #:rule1 #:rule2)
magic)) ; this needs to be done
please point out impracticalities and other mistakes of all magnitudes.
we need to include words for contexts and ways to delete rules.
a rough grammar would be
with messages from {[file filename]|[stream streamname]}
{with rule <rule-syntax>}+
<rule-syntax> := matching [regexp] message and <rule-syntax-clauses>
essentially, with rule means create a new rule and, "and rule" implies
generate a new rule. the part with "length > 10" would be (method op
form) where method would expand as (lambda (#:msg) (op (method msg)
form)). This way, adding new classes of message could have other
methods called. We probably need to say
perform method op form so that method can be anything.
i'm just throwing ideas. will do concrete work over the week whenever
i can squeeze it in.
i'll download the latest source tomorrow :-)
cheers
vijay
- [Logs-devel] LoGS userfriendliness?,
Vijay Lakshminarayanan <=