summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f5f3eb3)
raw | patch | inline | side by side (parent: f5f3eb3)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 6 Oct 2014 06:24:13 +0000 (08:24 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 6 Oct 2014 06:24:13 +0000 (08:24 +0200) |
diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y
index 08f8414142f58123dd63c9cf7c991d96c6bff5ff..9cf98eef406c2b5ecb54096706fd4abba8849050 100644 (file)
--- a/src/frontend/grammar.y
+++ b/src/frontend/grammar.y
* Parse matchers comparing object attributes with a value.
*/
compare_matcher:
- ':' IDENTIFIER op expression
+ '.' IDENTIFIER op expression
{
$$ = sdb_store_matcher_parse_field_cmp($2, $3, $4);
free($2); $2 = NULL;
sdb_object_deref(SDB_OBJ($3)); $3 = NULL;
}
|
- ':' IDENTIFIER
+ '.' IDENTIFIER
{
int field = sdb_store_parse_field_name($2);
free($2); $2 = NULL;
index 1e1028c5738cfbd2347f9d0383624cb6c0dce185..677ce2fe0de18af1e27e249d0c8c8f2929cee546 100755 (executable)
output="$( run_sysdb -H "$SOCKET_FILE" \
-c "LOOKUP hosts MATCHING attribute != 'architecture'
- FILTER :age >= 0s" )"
+ FILTER .age >= 0s" )"
echo "$output" \
| grep -F '"some.host.name"' \
| grep -F '"localhost"'
output="$( run_sysdb -H "$SOCKET_FILE" \
-c "LOOKUP hosts MATCHING attribute != 'architecture'
- FILTER :last_update < 2Y" )"
+ FILTER .last_update < 2Y" )"
echo $output | grep -E '^\[\]$'
output="$( run_sysdb -H "$SOCKET_FILE" \
- -c "LOOKUP hosts FILTER :backend = 'backend::mock_plugin'" )"
+ -c "LOOKUP hosts FILTER .backend = 'backend::mock_plugin'" )"
echo "$output" \
| grep -F '"host1.example.com"' \
| grep -F '"host2.example.com"' \
| grep -F '"other.host.name"' \
| grep -F '"some.host.name"'
output="$( run_sysdb -H "$SOCKET_FILE" \
- -c "LOOKUP hosts FILTER :backend = 'invalid'" )"
+ -c "LOOKUP hosts FILTER .backend = 'invalid'" )"
echo $output | grep -E '^\[\]$'
output="$( run_sysdb -H "$SOCKET_FILE" \
index af680f033865d773a35ed680176818d865c7110d..e5a0a74c4becffff53d479a174d60daf97bf2b4d 100644 (file)
{ "interval", "!=", &datetime, MATCHER_NOT },
{ "backend", "=", &string, MATCHER_EQ },
{ "backend", "!=", &string, MATCHER_NOT },
- /* the behavior for other operators on :backend
+ /* the behavior for other operators on .backend
* is currently unspecified */
{ "last_update", "=", NULL, -1 },
{ "last_update", "IS", NULL, -1 },
index 1412ee56fa88d5c1a73e937a2bd2c982d5c6fa6b..7560a5fe9af7a89c177559d8fd7e54fdb36d5d5c 100644 (file)
"service =~ 'r'", -1, 1, CONNECTION_LOOKUP },
{ "LOOKUP hosts MATCHING "
"host =~ 'p' "
- "FILTER :age > 1D", -1, 1, CONNECTION_LOOKUP },
+ "FILTER .age > 1D", -1, 1, CONNECTION_LOOKUP },
{ "LOOKUP hosts MATCHING "
"host =~ 'p' "
- "FILTER :age > 1D AND "
- ":interval < 240s" , -1, 1, CONNECTION_LOOKUP },
+ "FILTER .age > 1D AND "
+ ".interval < 240s" , -1, 1, CONNECTION_LOOKUP },
{ "LOOKUP hosts MATCHING "
"host =~ 'p' "
- "FILTER NOT :age>1D", -1, 1, CONNECTION_LOOKUP },
+ "FILTER NOT .age>1D", -1, 1, CONNECTION_LOOKUP },
{ "LOOKUP hosts MATCHING "
"host =~ 'p' "
- "FILTER :age>"
- ":interval", -1, 1, CONNECTION_LOOKUP },
+ "FILTER .age>"
+ ".interval", -1, 1, CONNECTION_LOOKUP },
{ "TIMESERIES 'host'.'metric' "
"START 2014-01-01 "
{ "attribute[foo] IS NOT NULL", -1, MATCHER_NOT },
/* object field matchers */
- { ":last_update < 10s", -1, MATCHER_LT },
- { ":AGE <= 1m", -1, MATCHER_LE },
- { ":interval = 10h", -1, MATCHER_EQ },
- { ":Last_Update >= 24D", -1, MATCHER_GE },
- { ":age > 1M", -1, MATCHER_GT },
- { ":age != 20Y", -1, MATCHER_NOT },
- { ":backend != 'be'", -1, MATCHER_NOT },
- { ":age <= 2 * :interval", -1, MATCHER_LE },
+ { ".last_update < 10s", -1, MATCHER_LT },
+ { ".AGE <= 1m", -1, MATCHER_LE },
+ { ".interval = 10h", -1, MATCHER_EQ },
+ { ".Last_Update >= 24D", -1, MATCHER_GE },
+ { ".age > 1M", -1, MATCHER_GT },
+ { ".age != 20Y", -1, MATCHER_NOT },
+ { ".backend != 'be'", -1, MATCHER_NOT },
+ { ".age <= 2 * .interval", -1, MATCHER_LE },
/* check operator precedence */
{ "host = 'name' OR "