Go to the documentation of this file.
35 const Packet *p,
const uint64_t tx_id,
const uint32_t rule_cnt,
36 const uint32_t pkt_prefilter_cnt)
45 jb_open_object(js,
"inspectedrules");
46 jb_set_string(js,
"inspect_type",
"tx");
47 jb_set_uint(js,
"rule_group_id", sgh->
id);
48 jb_set_uint(js,
"rule_cnt", rule_cnt);
49 jb_set_uint(js,
"pkt_rule_cnt", pkt_prefilter_cnt);
52 jb_open_array(js,
"rules");
53 for (uint32_t x = 0; x < rule_cnt; x++) {
58 jb_append_uint(js, s->
id);
64 const char *filename =
"packet_inspected_rules.json";
66 char log_path[PATH_MAX] =
"";
67 snprintf(log_path,
sizeof(log_path),
"%s/%s", log_dir, filename);
70 FILE *fp = fopen(log_path,
"a");
72 fwrite(jb_ptr(js), jb_len(js), 1, fp);
90 jb_open_object(js,
"inspectedrules");
91 jb_set_string(js,
"inspect_type",
"packet");
92 jb_set_uint(js,
"rule_group_id", sgh->
id);
96 jb_open_array(js,
"rules");
101 jb_append_uint(js, s->
id);
108 const char *filename =
"packet_inspected_rules.json";
110 char log_path[PATH_MAX] =
"";
111 snprintf(log_path,
sizeof(log_path),
"%s/%s", log_dir, filename);
114 FILE *fp = fopen(log_path,
"a");
116 fwrite(jb_ptr(js), jb_len(js), 1, fp);
void RulesDumpTxMatchArray(const DetectEngineThreadCtx *det_ctx, const SigGroupHead *sgh, const Packet *p, const uint64_t tx_id, const uint32_t rule_cnt, const uint32_t pkt_prefilter_cnt)
Container for matching data for a signature group.
SCMutex g_rule_dump_write_m
const char * AppProtoToString(AppProto alproto)
Maps the ALPROTO_*, to its string equivalent.
#define SCMUTEX_INITIALIZER
RuleMatchCandidateTx * tx_candidates
#define SCMutexUnlock(mut)
JsonBuilder * CreateEveHeader(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, OutputJsonCtx *eve_ctx)
JsonBuilder * CreateEveHeaderWithTxId(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, uint64_t tx_id, OutputJsonCtx *eve_ctx)
void RulesDumpMatchArray(const DetectEngineThreadCtx *det_ctx, const SigGroupHead *sgh, const Packet *p)
const char * ConfigGetLogDirectory(void)
uint32_t non_pf_store_cnt
AppProto alproto
application level protocol