From 65076e28dfed0765e51c69be81a7842331aae1d2 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Sun, 3 Jul 2011 17:09:09 +0200 Subject: milestone: grammar for basic if/then construct (no expr) --- grammar/mini.samp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 grammar/mini.samp (limited to 'grammar/mini.samp') diff --git a/grammar/mini.samp b/grammar/mini.samp new file mode 100644 index 00000000..54efacec --- /dev/null +++ b/grammar/mini.samp @@ -0,0 +1,32 @@ +#global (dnscache="yes" arg1="1 2" arg2 = "1 2" arg3 ="1=2\"3") +action(type="omuser" target="all") +global (dnscache="no" b="2") +$FileOwner root +*.* * +$action somelog 1 +& /var/log/somelog +$action log2 1 +$action log2 2 +$action log2 3 +& action(type="fwd" target="10.1.1.2") +& /var/log/log2 + +if 1 then /var/log/log3 +/* sample bwlow is v7 +if 1 then { /var/log/log3 + if 2 then /var/log/log4 + *.* /var/log/log4b +} +*/ +*.* { /var/log/log5 + /var/log/log6 + $port 514 + @@fwd + rger + } +if 1/*pri("*.*")*/ then { + action(type="omfile" taget="/var/log/log5") + action(type="omfile" taget="/var/log/log6") + action(type="omfwd" taget="10.0.0.1" port="514") + action(type="omwusr" taget="rger") +} -- cgit From 719962c1f0f1ee1a6d5b5389417fb68adcde431b Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Sun, 3 Jul 2011 18:13:23 +0200 Subject: milestone: added grammar for arithmetic expressions --- grammar/mini.samp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grammar/mini.samp') diff --git a/grammar/mini.samp b/grammar/mini.samp index 54efacec..6aae758d 100644 --- a/grammar/mini.samp +++ b/grammar/mini.samp @@ -24,7 +24,7 @@ if 1 then { /var/log/log3 @@fwd rger } -if 1/*pri("*.*")*/ then { +if 2*4/5--(10-3)/*pri("*.*")*/ then { action(type="omfile" taget="/var/log/log5") action(type="omfile" taget="/var/log/log6") action(type="omfwd" taget="10.0.0.1" port="514") -- cgit From 849e4aa8e6437cbfb6efbc7379414fcf517e6db9 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Sun, 3 Jul 2011 18:19:32 +0200 Subject: grammar: small optimization during expr creation --- grammar/mini.samp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grammar/mini.samp') diff --git a/grammar/mini.samp b/grammar/mini.samp index 6aae758d..9e00b7cf 100644 --- a/grammar/mini.samp +++ b/grammar/mini.samp @@ -24,7 +24,7 @@ if 1 then { /var/log/log3 @@fwd rger } -if 2*4/5--(10-3)/*pri("*.*")*/ then { +if 2*4/-5--(10-3)/*pri("*.*")*/ then { action(type="omfile" taget="/var/log/log5") action(type="omfile" taget="/var/log/log6") action(type="omfwd" taget="10.0.0.1" port="514") -- cgit From 71003f146cc2dacfa8fc7c084404f3399812b64a Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 4 Jul 2011 08:34:13 +0200 Subject: milestone: added operations to expr, added evaluation --- grammar/mini.samp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grammar/mini.samp') diff --git a/grammar/mini.samp b/grammar/mini.samp index 9e00b7cf..8e00917f 100644 --- a/grammar/mini.samp +++ b/grammar/mini.samp @@ -24,7 +24,7 @@ if 1 then { /var/log/log3 @@fwd rger } -if 2*4/-5--(10-3)/*pri("*.*")*/ then { +if not 1==0 and 2*4/-5--(10-3)>7/*pri("*.*")*/ then { action(type="omfile" taget="/var/log/log5") action(type="omfile" taget="/var/log/log6") action(type="omfwd" taget="10.0.0.1" port="514") -- cgit From 25cd9f59ad3a0daa2662e44b2e844116ad487450 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 4 Jul 2011 09:36:12 +0200 Subject: milestone: added comparison ops, prepring for flex include processing --- grammar/mini.samp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grammar/mini.samp') diff --git a/grammar/mini.samp b/grammar/mini.samp index 8e00917f..71cfbb69 100644 --- a/grammar/mini.samp +++ b/grammar/mini.samp @@ -24,7 +24,7 @@ if 1 then { /var/log/log3 @@fwd rger } -if not 1==0 and 2*4/-5--(10-3)>7/*pri("*.*")*/ then { +if not (1==0) and 2*4/-5--(10-3)>7/*pri("*.*")*/ then { action(type="omfile" taget="/var/log/log5") action(type="omfile" taget="/var/log/log6") action(type="omfwd" taget="10.0.0.1" port="514") -- cgit From 183641a091a3d7b5eabe4419db4ebd2b6f84934e Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 4 Jul 2011 18:25:17 +0200 Subject: milestone: added functions to grammar --- grammar/mini.samp | 1 + 1 file changed, 1 insertion(+) (limited to 'grammar/mini.samp') diff --git a/grammar/mini.samp b/grammar/mini.samp index 71cfbb69..505ae67a 100644 --- a/grammar/mini.samp +++ b/grammar/mini.samp @@ -30,3 +30,4 @@ if not (1==0) and 2*4/-5--(10-3)>7/*pri("*.*")*/ then { action(type="omfwd" taget="10.0.0.1" port="514") action(type="omwusr" taget="rger") } +if getenv("user") == "test" then /var/log/testlog -- cgit From 84ca2c443680de2c7e98f27972fb6300a025d62d Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Jul 2011 15:32:11 +0200 Subject: better check for config errors --- grammar/mini.samp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'grammar/mini.samp') diff --git a/grammar/mini.samp b/grammar/mini.samp index 505ae67a..3bb0de44 100644 --- a/grammar/mini.samp +++ b/grammar/mini.samp @@ -1,5 +1,5 @@ #global (dnscache="yes" arg1="1 2" arg2 = "1 2" arg3 ="1=2\"3") -action(type="omuser" target="all") +action(type="omuser" target="all" target="all2") global (dnscache="no" b="2") $FileOwner root *.* * @@ -28,6 +28,6 @@ if not (1==0) and 2*4/-5--(10-3)>7/*pri("*.*")*/ then { action(type="omfile" taget="/var/log/log5") action(type="omfile" taget="/var/log/log6") action(type="omfwd" taget="10.0.0.1" port="514") - action(type="omwusr" taget="rger") + action(type="omwusr" taget="rger" taget="rger2") } if getenv("user") == "test" then /var/log/testlog -- cgit