Go to the documentation of this file.
52 JsonBuilder *js_resplist = NULL;
54 js_resplist = jb_new_array();
63 jb_set_string_from_bytes(jb,
65 (
const uint8_t *)tx->
request + min_length,
74 bool reply_truncated =
false;
79 bool is_cc_array_open =
false;
82 uint8_t *where = response->
str;
85 if (response->
len > 0 && response->
len <= UINT16_MAX) {
86 length = (uint16_t)response->
len - 1;
87 }
else if (response->
len > UINT16_MAX) {
90 if (!reply_truncated && response->
truncated) {
91 reply_truncated =
true;
98 if (isdigit(where[0]) && isdigit(where[1]) && isdigit(where[2])) {
99 if (!is_cc_array_open) {
100 jb_open_array(jb,
"completion_code");
101 is_cc_array_open =
true;
103 jb_append_string_from_bytes(jb, (
const uint8_t *)where, 3);
109 jb_append_string_from_bytes(js_resplist, (
const uint8_t *)where +
offset, pos -
offset);
118 if (is_cc_array_open) {
122 jb_close(js_resplist);
123 jb_set_object(jb,
"reply", js_resplist);
125 jb_free(js_resplist);
129 jb_set_uint(jb,
"dynamic_port", tx->
dyn_port);
147 if (reply_truncated) {
155 static int JsonFTPLogger(
ThreadVars *
tv,
void *thread_data,
156 const Packet *p,
Flow *f,
void *state,
void *vtx, uint64_t tx_id)
161 const char *event_type;
163 event_type =
"ftp_data";
172 jb_open_object(jb, event_type);
176 EveFTPLogCommand(tx, jb);
const uint8_t command_length
const FtpCommand * command_descriptor
OutputInitResult OutputJsonLogInitSub(ConfNode *conf, OutputCtx *parent_ctx)
struct HtpBodyChunk_ * next
TmEcode JsonLogThreadInit(ThreadVars *t, const void *initdata, void **data)
int OutputJsonBuilderBuffer(JsonBuilder *js, OutputJsonThreadCtx *ctx)
#define TAILQ_EMPTY(head)
#define TAILQ_FOREACH(var, head, field)
FtpRequestCommand command
const char * command_name
#define JB_SET_STRING(jb, key, val)
void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
Per thread variable structure.
#define JB_SET_TRUE(jb, key)
JsonBuilder * CreateEveHeaderWithTxId(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, uint64_t tx_id, OutputJsonCtx *eve_ctx)
void OutputRegisterTxSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
#define JB_SET_FALSE(jb, key)
void JsonFTPLogRegister(void)
void EveFTPDataAddMetadata(const Flow *f, JsonBuilder *jb)
TmEcode JsonLogThreadDeinit(ThreadVars *t, void *data)
uint16_t JsonGetNextLineFromBuffer(const char *buffer, const uint16_t len)
AppProto alproto
application level protocol