action = "blocked";
}
+ /* Add tx_id to root element for correlation with other events. */
+ json_object_del(js, "tx_id");
+ if (pa->flags & PACKET_ALERT_FLAG_TX)
+ json_object_set_new(js, "tx_id", json_integer(pa->tx_id));
+
json_t *ajs = json_object();
if (ajs == NULL) {
json_decref(js);
json_string((pa->s->class_msg) ? pa->s->class_msg : ""));
json_object_set_new(ajs, "severity", json_integer(pa->s->prio));
- if (pa->flags & PACKET_ALERT_FLAG_TX)
- json_object_set_new(ajs, "tx_id", json_integer(pa->tx_id));
-
if (p->tenant_id > 0)
json_object_set_new(ajs, "tenant_id", json_integer(p->tenant_id));
if (http_ctx->flags & LOG_HTTP_EXTENDED)
JsonHttpLogJSONExtended(hjs, tx);
- /* tx id for correlation with alerts */
- json_object_set_new(hjs, "tx_id", json_integer(tx_id));
-
json_object_set_new(js, "http", hjs);
}
JsonHttpLogThread *jhl = (JsonHttpLogThread *)thread_data;
MemBuffer *buffer = (MemBuffer *)jhl->buffer;
- json_t *js = CreateJSONHeader((Packet *)p, 1, "http"); //TODO const
+ json_t *js = CreateJSONHeaderWithTxId((Packet *)p, 1, "http", tx_id); //TODO const
if (unlikely(js == NULL))
return TM_ECODE_OK;
MemBuffer *buffer = (MemBuffer *)jhl->buffer;
json_t *sjs;
- json_t *js = CreateJSONHeader((Packet *)p, 1, "smtp");
+ json_t *js = CreateJSONHeaderWithTxId((Packet *)p, 1, "smtp", tx_id);
if (unlikely(js == NULL))
return TM_ECODE_OK;