[boolean](15-language-reference.md#boolean-literals)) for expression conditions (`assign where`, `ignore where`)
* As [array](15-language-reference.md#array) or [dictionary](15-language-reference.md#dictionary) attribute with nested values
(e.g. dictionaries in dictionaries) in [apply for](3-monitoring-basics.md#using-apply-for) rules.
+* As a [function object](#functions)
Features like [DB IDO](3-monitoring-basics.md#db-ido), Livestatus(#setting-up-livestatus) or StatusData(#status-data)
dump this column as encoded JSON string, and set `is_json` resp. `cv_is_json` to `1`.
#include "base/logger.hpp"
#include "base/context.hpp"
#include "base/dynamicobject.hpp"
+#include "base/scriptframe.hpp"
#include <boost/foreach.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/join.hpp>
size_t offset, pos_first, pos_second;
offset = 0;
+ Dictionary::Ptr resolvers_this;
+
String result = str;
while ((pos_first = result.FindFirstOf("$", offset)) != String::NPos) {
pos_second = result.FindFirstOf("$", pos_first + 1);
found = true;
}
+ if (resolved_macro.IsObjectType<Function>()) {
+ Function::Ptr func = resolved_macro;
+
+ if (!resolvers_this) {
+ resolvers_this = new Dictionary();
+
+ BOOST_FOREACH(const ResolverSpec& resolver, resolvers) {
+ resolvers_this->Set(resolver.first, resolver.second);
+ }
+ }
+
+ ScriptFrame frame(resolvers_this);
+ std::vector<Value> args;
+ resolved_macro = func->Invoke(args);
+ }
+
if (!found) {
if (!missingMacro)
Log(LogWarning, "MacroProcessor")