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
c31411b4cc
Merge pull request #4 from draios/parser-work
...
Parser work
2016-02-22 13:32:12 -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
b41794f6a9
Update README.md
2016-02-21 20:31:33 -08:00
Henri DF
5a3c191c97
Update README.md
2016-02-21 20:29:47 -08:00
Henri DF
37da302b39
Update README.md
2016-02-21 15:11:13 -08:00
Henri DF
8d7efbfc6b
Merge pull request #3 from draios/lua-move
...
Lua move
2016-02-21 13:44:01 -08:00
Henri DF
c7bafc9a49
Move lua/ to userspace/digwatch
2016-02-21 13:43:08 -08:00
Henri DF
e50dd885c2
Remove cruft from lua/rule_loader.lua
2016-02-21 13:40:34 -08:00
Henri DF
601ad3b620
Merge pull request #2 from draios/digwatch-scaffolding
...
Digwatch initial implementation
2016-02-20 21:27:36 -08:00
Henri DF
3d58c3c9ae
Compile and load digwatch rules!
2016-02-20 21:25:41 -08:00
Henri DF
e1cdd62f2f
Change representation of relational ops in AST
2016-02-20 21:17:00 -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
19cb8cc4f2
sysdig-parser.lua -> compiler.lua
2016-02-20 19:31:20 +00: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
c63657acad
typoes
2016-02-19 16:26:12 -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
Henri DF
ab52c42026
remove notes file
2016-02-18 09:37:45 -08:00
Henri DF
b97a1bfc1f
Merge pull request #1 from draios/parser-hacking
...
Digwatch compiler
2016-02-15 16:04:51 -08:00
Henri DF
6e2d8679c4
Macro expansion
2016-02-15 15:19:43 -08:00
Henri DF
b3f7b1d765
Remove whitespace from token values in AST
2016-02-14 21:26:37 -08:00
Henri DF
c21e8207f8
Don't allow '=' in BareStrings
2016-02-14 21:22:20 -08:00
Henri DF
aeba0760db
Scaffold basic line-oriented compiler API
2016-02-14 14:31:10 -08:00
Henri DF
0d10a3f39c
Fix multi-line comments
2016-02-13 15:26:40 -08:00
Henri DF
79cdf31aa7
Expand in
relational expressions
...
For example, `a.b in [1, 2]` is expanded to `a.b = 1 or a.b = 2`.
This is done over the AST, not filter text.
2016-02-13 15:23:03 -08:00
Henri DF
3dab9edc9d
add a function to pretty-print ASTs
2016-02-13 15:23:03 -08:00
Henri DF
48685f4f2f
Don't require quoting for non-alphanum characters
...
This commit removes the one remaining (known) difference with the sysdig
c++ parser: relational expression right-hand sides now _only_ need to be
quoted if they contain a paren or a space.
So you can now do things like "fd.name contains (.log and event.dir = <"
without needing to quote "*.log" or "<".
2016-02-13 15:23:03 -08:00
Henri DF
41ee6e49a5
Grammar for filters and macros
2016-02-13 15:23:03 -08:00
Henri DF
4bd8a9d401
Initial README
2016-01-20 14:47:56 -08:00