~~~~~~~~
The monitor command allows you to listen to Netlink events produced by the
nf_tables subsystem, related to creation and deletion of objects. When they
-occur, nft will print to stdout the monitored events in either XML, JSON or
+occur, nft will print to stdout the monitored events in either JSON or
native nft format. +
To filter events related to a concrete object, use one of the keywords 'tables', 'chains', 'sets', 'rules', 'elements', 'ruleset'. +
% nft monitor
--------------------------------------------------
-.Listen to added tables, report in XML format
---------------------------------------------
-% nft monitor new tables xml
---------------------------------------------
-
.Listen to deleted rules, report in JSON format
-----------------------------------------------
-% nft monitor destroy rules json
+% nft -j monitor destroy rules
-----------------------------------------------
.Listen to both new and destroyed chains, in native nft format
.debug_mask = ctx->nft->debug_mask,
};
+ if (nft_output_json(&ctx->nft->output))
+ monhandler.format = NFTNL_OUTPUT_JSON;
+
monhandler.cache_needed = need_cache(cmd);
if (monhandler.cache_needed) {
struct rule *rule, *nrule;