Commit Graph

1527 Commits

Author SHA1 Message Date
Henri DF
a2ec9870de compiler.lua: consistently use 'ast' instead of 'node' 2016-02-24 08:46:33 -08:00
Henri DF
e725be968e rule_loader.lua: add/improve comments 2016-02-24 08:46:12 -08:00
Henri DF
a9d0268390 Move format handling into own class 2016-02-23 18:55:20 -08:00
Henri DF
636429c674 Move lua_State creation to digwatch main 2016-02-23 18:43:41 -08:00
Henri DF
3e73f01472 Always print events
Before this change, events were only printed if they had all the
fields (same behavior as with sysdig when the output format doesn't have
a leading "*"). With this change, all events are printed; those that
don't have all fields are prefixed with a notification.
2016-02-23 18:15:43 -08:00
Henri DF
2f105932fa parser-smoke.sh: add a test 2016-02-23 11:35:11 -08:00
Henri DF
87186df85a digwatch: use appropriate formatter for each event 2016-02-23 10:21:25 -08:00
Henri DF
a3976281a8 Pass rule indices down into filters
This allows to match events back up with the display output they are
associated with.
2016-02-23 18:09:52 +00:00
Henri DF
406f079621 Deep copy macro ASTs when expanding
So that we can individually tag expressions that originate from the same macro (see next commit).
2016-02-23 18:09:52 +00:00
Henri DF
3a56c1a0e4 AST: Rule node always has an Output child node 2016-02-23 18:09:52 +00:00
Henri DF
a7d0132154 Add 'sysdig.set_formatter' and use it in compiler
This allows the compiler to define per-rule formats. They are currently
instantiated and stored on the c++ side, but not being made use of yet.
2016-02-23 18:09:51 +00:00
Henri DF
426097241d Move compiler state and AST grafting to rule_loader.lua
This is needed so that rule_loader (which should be renamed in a later pass..) can tag
filters with their index.
2016-02-22 18:07:54 -08:00
Henri DF
5ba821aaef Fix handling of nested ASTs 2016-02-22 16:26:15 -08:00
Henri DF
d759e3b942 Fix macro expansion bug introduced with Rules 2016-02-22 16:01:40 -08:00
Henri DF
bba5aa6974 Add support for output formats 2016-02-22 21:31:21 +00:00
Henri DF
05362e2c68 compiler: don't fail on empty lines 2016-02-22 21:31:21 +00:00
Henri DF
7853260f38 fix test script 2016-02-22 21:31:21 +00:00
Henri DF
e5637d0cee specify lua5.1 in test.lua 2016-02-22 21:31:21 +00:00
Henri DF
c7bafc9a49 Move lua/ to userspace/digwatch 2016-02-21 13:43:08 -08:00
Henri DF
3d58c3c9ae Compile and load digwatch rules! 2016-02-20 21:25:41 -08:00
Henri DF
9fef5a7b29 Rework loading of Lua and rules files 2016-02-20 16:21:56 -08:00
Henri DF
9b89116a26 Add config_digwatch.h.in 2016-02-20 13:38:57 -08:00
Henri DF
9899680064 Lua parser refactoring
Move compiler loading out of libsinsp/lua_parser.cpp and into a new
class in digwatch/rules.cpp.

This way the libsinsp support is strictly about providing a lua API for
scripts to setup filters. Loading the actual parser and rules is logic
that belongs in the app (digwatch in this case, maybe sysdig down the
line) rather than there.
2016-02-19 20:30:23 -08:00
Henri DF
208930fd55 Simplify error handling in digwatch main 2016-02-19 14:50:51 -08:00
Henri DF
32ad5673c6 Pass filter object into sinsp::set_filter() 2016-02-18 21:09:26 -08:00
Henri DF
4c371e5b1d Add curl dependency 2016-02-19 01:58:17 +00:00
Henri DF
0a294cd5e5 digwatch scaffolding
basic cmake setup and digwatch binary, mostly pulled from sysdig
2016-02-19 01:58:17 +00:00