suricata
output.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-2024 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author OISF, Jason Ish <jason.ish@oisf.net>
22  * \author Endace Technology Limited, Jason Ish <jason.ish@endace.com>
23  *
24  * The root logging output for all non-application logging.
25  *
26  * The loggers are made up of a hierarchy of loggers. At the top we
27  * have the root logger which is the main entry point to
28  * logging. Under the root there exists parent loggers that are the
29  * entry point for specific types of loggers such as packet logger,
30  * transaction loggers, etc. Each parent logger may have 0 or more
31  * loggers that actual handle the job of producing output to something
32  * like a file.
33  */
34 
35 #include "suricata-common.h"
36 #include "flow.h"
37 #include "conf.h"
38 #include "tm-threads.h"
39 #include "util-error.h"
40 #include "util-debug.h"
41 #include "output.h"
42 #include "output-eve-bindgen.h"
43 
44 #include "alert-fastlog.h"
45 #include "alert-debuglog.h"
46 #include "alert-syslog.h"
47 #include "output-json.h"
48 #include "output-json-alert.h"
49 #include "output-json-anomaly.h"
50 #include "output-json-flow.h"
51 #include "output-json-netflow.h"
52 #include "log-cf-common.h"
53 #include "output-json-drop.h"
54 #include "output-eve-stream.h"
55 #include "log-httplog.h"
56 #include "output-json-http.h"
57 #include "output-json-dns.h"
58 #include "output-json-mdns.h"
59 #include "log-tlslog.h"
60 #include "log-tlsstore.h"
61 #include "output-json-tls.h"
62 #include "log-pcap.h"
63 // for SSHTxLogCondition
64 #include "app-layer-ssh.h"
65 #include "output-json-file.h"
66 #include "output-json-smtp.h"
67 #include "output-json-stats.h"
68 #include "log-tcp-data.h"
69 #include "log-stats.h"
70 #include "output-json-nfs.h"
71 #include "output-json-ftp.h"
72 // for misplaced EveFTPDataAddMetadata
73 #include "app-layer-ftp.h"
74 #include "output-json-smb.h"
75 #include "output-json-ike.h"
76 #include "output-json-dhcp.h"
77 #include "output-json-mqtt.h"
78 #include "output-json-pgsql.h"
79 #include "output-lua.h"
80 #include "output-json-dnp3.h"
81 #include "output-json-metadata.h"
82 #include "output-json-dcerpc.h"
83 #include "output-json-frame.h"
84 #include "app-layer-parser.h"
85 #include "output-filestore.h"
86 #include "output-json-arp.h"
87 
88 typedef struct RootLogger_ {
94 
95  TAILQ_ENTRY(RootLogger_) entries;
97 
98 /* List of registered root loggers. These are registered at start up and
99  * are independent of configuration. Later we will build a list of active
100  * loggers based on configuration. */
101 static TAILQ_HEAD(, RootLogger_) registered_loggers =
102  TAILQ_HEAD_INITIALIZER(registered_loggers);
103 
104 /* List of active root loggers. This means that at least one logger is enabled
105  * for each root logger type in the config. */
106 static TAILQ_HEAD(, RootLogger_) active_loggers =
107  TAILQ_HEAD_INITIALIZER(active_loggers);
108 
109 typedef struct LoggerThreadStoreNode_ {
110  void *thread_data;
111  TAILQ_ENTRY(LoggerThreadStoreNode_) entries;
113 
114 typedef TAILQ_HEAD(LoggerThreadStore_, LoggerThreadStoreNode_) LoggerThreadStore;
115 
116 /**
117  * The list of all registered (known) output modules.
118  */
120 
121 /**
122  * Registry of flags to be updated on file rotation notification.
123  */
124 typedef struct OutputFileRolloverFlag_ {
125  int *flag;
126 
127  TAILQ_ENTRY(OutputFileRolloverFlag_) entries;
129 
130 static SCMutex output_file_rotation_mutex = SCMUTEX_INITIALIZER;
131 
132 TAILQ_HEAD(, OutputFileRolloverFlag_) output_file_rotation_flags =
133  TAILQ_HEAD_INITIALIZER(output_file_rotation_flags);
134 
135 void OutputRegisterRootLoggers(void);
136 void OutputRegisterLoggers(void);
137 
138 /**
139  * \brief Register an output module.
140  *
141  * This function will register an output module so it can be
142  * configured with the configuration file.
143  *
144  * \retval Returns 0 on success, -1 on failure.
145  */
146 void OutputRegisterModule(const char *name, const char *conf_name,
147  OutputInitFunc InitFunc)
148 {
149  OutputModule *module = SCCalloc(1, sizeof(*module));
150  if (unlikely(module == NULL))
151  goto error;
152 
153  module->name = name;
154  module->conf_name = conf_name;
155  module->InitFunc = InitFunc;
156  TAILQ_INSERT_TAIL(&output_modules, module, entries);
157 
158  SCLogDebug("Output module \"%s\" registered.", name);
159 
160  return;
161 
162 error:
163  FatalError("Fatal error encountered in OutputRegisterModule. Exiting...");
164 }
165 
166 /**
167  * \brief Register a packet output module.
168  *
169  * This function will register an output module so it can be
170  * configured with the configuration file.
171  *
172  * \retval Returns 0 on success, -1 on failure.
173  */
174 void OutputRegisterPacketModule(LoggerId id, const char *name, const char *conf_name,
175  OutputInitFunc InitFunc, OutputPacketLoggerFunctions *output_module_functions)
176 {
177  if (unlikely(output_module_functions->LogFunc == NULL ||
178  output_module_functions->ConditionFunc == NULL)) {
179  goto error;
180  }
181 
182  OutputModule *module = SCCalloc(1, sizeof(*module));
183  if (unlikely(module == NULL)) {
184  goto error;
185  }
186 
187  module->logger_id = id;
188  module->name = name;
189  module->conf_name = conf_name;
190  module->InitFunc = InitFunc;
191  module->PacketLogFunc = output_module_functions->LogFunc;
192  module->PacketFlushFunc = output_module_functions->FlushFunc;
193  module->PacketConditionFunc = output_module_functions->ConditionFunc;
194  module->ThreadInit = output_module_functions->ThreadInitFunc;
195  module->ThreadDeinit = output_module_functions->ThreadDeinitFunc;
196  TAILQ_INSERT_TAIL(&output_modules, module, entries);
197 
198  SCLogDebug("Packet logger \"%s\" registered.", name);
199  return;
200 error:
201  FatalError("Fatal error encountered. Exiting...");
202 }
203 
204 /**
205  * \brief Register a packet output sub-module.
206  *
207  * This function will register an output module so it can be
208  * configured with the configuration file.
209  *
210  * \retval Returns 0 on success, -1 on failure.
211  */
212 void OutputRegisterPacketSubModule(LoggerId id, const char *parent_name, const char *name,
213  const char *conf_name, OutputInitSubFunc InitFunc,
214  OutputPacketLoggerFunctions *output_logger_functions)
215 {
216  if (unlikely(output_logger_functions->LogFunc == NULL ||
217  output_logger_functions->ConditionFunc == NULL)) {
218  goto error;
219  }
220 
221  OutputModule *module = SCCalloc(1, sizeof(*module));
222  if (unlikely(module == NULL)) {
223  goto error;
224  }
225 
226  module->logger_id = id;
227  module->name = name;
228  module->conf_name = conf_name;
229  module->parent_name = parent_name;
230  module->InitSubFunc = InitFunc;
231  module->PacketLogFunc = output_logger_functions->LogFunc;
232  module->PacketFlushFunc = output_logger_functions->FlushFunc;
233  module->PacketConditionFunc = output_logger_functions->ConditionFunc;
234  module->ThreadInit = output_logger_functions->ThreadInitFunc;
235  module->ThreadDeinit = output_logger_functions->ThreadDeinitFunc;
236  TAILQ_INSERT_TAIL(&output_modules, module, entries);
237 
238  SCLogDebug("Packet logger \"%s\" registered.", name);
239  return;
240 error:
241  FatalError("Fatal error encountered. Exiting...");
242 }
243 
244 /**
245  * \brief Wrapper function for tx output modules.
246  *
247  * This function will register an output module so it can be
248  * configured with the configuration file.
249  *
250  * \retval Returns 0 on success, -1 on failure.
251  */
252 static void OutputRegisterTxModuleWrapper(LoggerId id, const char *name, const char *conf_name,
253  OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
254  int ts_log_progress, TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit,
255  ThreadDeinitFunc ThreadDeinit)
256 {
257  if (unlikely(TxLogFunc == NULL)) {
258  goto error;
259  }
260 
261  OutputModule *module = SCCalloc(1, sizeof(*module));
262  if (unlikely(module == NULL)) {
263  goto error;
264  }
265 
266  module->logger_id = id;
267  module->name = name;
268  module->conf_name = conf_name;
269  module->InitFunc = InitFunc;
270  module->TxLogFunc = TxLogFunc;
271  module->TxLogCondition = TxLogCondition;
272  module->alproto = alproto;
273  module->tc_log_progress = tc_log_progress;
274  module->ts_log_progress = ts_log_progress;
275  module->ThreadInit = ThreadInit;
276  module->ThreadDeinit = ThreadDeinit;
277  TAILQ_INSERT_TAIL(&output_modules, module, entries);
278 
279  SCLogDebug("Tx logger \"%s\" registered.", name);
280  return;
281 error:
282  FatalError("Fatal error encountered. Exiting...");
283 }
284 
285 static void OutputRegisterTxSubModuleWrapper(LoggerId id, const char *parent_name, const char *name,
286  const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
287  int tc_log_progress, int ts_log_progress, TxLoggerCondition TxLogCondition,
288  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
289 {
290  if (unlikely(TxLogFunc == NULL)) {
291  goto error;
292  }
293 
294  OutputModule *module = SCCalloc(1, sizeof(*module));
295  if (unlikely(module == NULL)) {
296  goto error;
297  }
298 
299  module->logger_id = id;
300  module->name = name;
301  module->conf_name = conf_name;
302  module->parent_name = parent_name;
303  module->InitSubFunc = InitFunc;
304  module->TxLogFunc = TxLogFunc;
305  module->TxLogCondition = TxLogCondition;
306  module->alproto = alproto;
307  module->tc_log_progress = tc_log_progress;
308  module->ts_log_progress = ts_log_progress;
309  module->ThreadInit = ThreadInit;
310  module->ThreadDeinit = ThreadDeinit;
311  TAILQ_INSERT_TAIL(&output_modules, module, entries);
312 
313  SCLogDebug("Tx logger for alproto %d \"%s\" registered.", alproto, name);
314  return;
315 error:
316  FatalError("Fatal error encountered. Exiting...");
317 }
318 
319 /**
320  * \brief Register a tx output module with condition.
321  *
322  * This function will register an output module so it can be
323  * configured with the configuration file.
324  *
325  * \retval Returns 0 on success, -1 on failure.
326  */
327 void OutputRegisterTxModuleWithCondition(LoggerId id, const char *name, const char *conf_name,
328  OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
329  TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
330 {
331  OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto, TxLogFunc, -1, -1,
332  TxLogCondition, ThreadInit, ThreadDeinit);
333 }
334 
335 void OutputRegisterTxSubModuleWithCondition(LoggerId id, const char *parent_name, const char *name,
336  const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
337  TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
338 {
339  OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc, alproto, TxLogFunc,
340  -1, -1, TxLogCondition, ThreadInit, ThreadDeinit);
341 }
342 
343 /**
344  * \brief Register a tx output module with progress.
345  *
346  * This function will register an output module so it can be
347  * configured with the configuration file.
348  *
349  * \retval Returns 0 on success, -1 on failure.
350  */
351 void OutputRegisterTxModuleWithProgress(LoggerId id, const char *name, const char *conf_name,
352  OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
353  int ts_log_progress, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
354 {
355  OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto, TxLogFunc,
356  tc_log_progress, ts_log_progress, NULL, ThreadInit, ThreadDeinit);
357 }
358 
359 void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name, const char *name,
360  const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
361  int tc_log_progress, int ts_log_progress, ThreadInitFunc ThreadInit,
362  ThreadDeinitFunc ThreadDeinit)
363 {
364  OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc, alproto, TxLogFunc,
365  tc_log_progress, ts_log_progress, NULL, ThreadInit, ThreadDeinit);
366 }
367 
368 /**
369  * \brief Register a tx output module.
370  *
371  * This function will register an output module so it can be
372  * configured with the configuration file.
373  *
374  * \retval Returns 0 on success, -1 on failure.
375  */
376 void OutputRegisterTxModule(LoggerId id, const char *name, const char *conf_name,
377  OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit,
378  ThreadDeinitFunc ThreadDeinit)
379 {
380  OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto, TxLogFunc, -1, -1, NULL,
381  ThreadInit, ThreadDeinit);
382 }
383 
384 void OutputRegisterTxSubModule(LoggerId id, const char *parent_name, const char *name,
385  const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
386  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
387 {
388  OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc, alproto, TxLogFunc,
389  -1, -1, NULL, ThreadInit, ThreadDeinit);
390 }
391 
392 /**
393  * \brief Register a file output sub-module.
394  *
395  * This function will register an output module so it can be
396  * configured with the configuration file.
397  *
398  * \retval Returns 0 on success, -1 on failure.
399  */
400 void OutputRegisterFileSubModule(LoggerId id, const char *parent_name, const char *name,
401  const char *conf_name, OutputInitSubFunc InitFunc, SCFileLogger FileLogFunc,
402  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
403 {
404  if (unlikely(FileLogFunc == NULL)) {
405  goto error;
406  }
407 
408  OutputModule *module = SCCalloc(1, sizeof(*module));
409  if (unlikely(module == NULL)) {
410  goto error;
411  }
412 
413  module->logger_id = id;
414  module->name = name;
415  module->conf_name = conf_name;
416  module->parent_name = parent_name;
417  module->InitSubFunc = InitFunc;
418  module->FileLogFunc = FileLogFunc;
419  module->ThreadInit = ThreadInit;
420  module->ThreadDeinit = ThreadDeinit;
421  TAILQ_INSERT_TAIL(&output_modules, module, entries);
422 
423  SCLogDebug("File logger \"%s\" registered.", name);
424  return;
425 error:
426  FatalError("Fatal error encountered. Exiting...");
427 }
428 
429 /**
430  * \brief Register a file data output module.
431  *
432  * This function will register an output module so it can be
433  * configured with the configuration file.
434  *
435  * \retval Returns 0 on success, -1 on failure.
436  */
437 void OutputRegisterFiledataModule(LoggerId id, const char *name, const char *conf_name,
438  OutputInitFunc InitFunc, SCFiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit,
439  ThreadDeinitFunc ThreadDeinit)
440 {
441  if (unlikely(FiledataLogFunc == NULL)) {
442  goto error;
443  }
444 
445  OutputModule *module = SCCalloc(1, sizeof(*module));
446  if (unlikely(module == NULL)) {
447  goto error;
448  }
449 
450  module->logger_id = id;
451  module->name = name;
452  module->conf_name = conf_name;
453  module->InitFunc = InitFunc;
454  module->FiledataLogFunc = FiledataLogFunc;
455  module->ThreadInit = ThreadInit;
456  module->ThreadDeinit = ThreadDeinit;
457  TAILQ_INSERT_TAIL(&output_modules, module, entries);
458 
459  SCLogDebug("Filedata logger \"%s\" registered.", name);
460  return;
461 error:
462  FatalError("Fatal error encountered. Exiting...");
463 }
464 
465 /**
466  * \brief Register a flow output sub-module.
467  *
468  * This function will register an output module so it can be
469  * configured with the configuration file.
470  *
471  * \retval Returns 0 on success, -1 on failure.
472  */
473 void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, const char *name,
474  const char *conf_name, OutputInitSubFunc InitFunc, FlowLogger FlowLogFunc,
475  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
476 {
477  if (unlikely(FlowLogFunc == NULL)) {
478  goto error;
479  }
480 
481  OutputModule *module = SCCalloc(1, sizeof(*module));
482  if (unlikely(module == NULL)) {
483  goto error;
484  }
485 
486  module->logger_id = id;
487  module->name = name;
488  module->conf_name = conf_name;
489  module->parent_name = parent_name;
490  module->InitSubFunc = InitFunc;
491  module->FlowLogFunc = FlowLogFunc;
492  module->ThreadInit = ThreadInit;
493  module->ThreadDeinit = ThreadDeinit;
494  TAILQ_INSERT_TAIL(&output_modules, module, entries);
495 
496  SCLogDebug("Flow logger \"%s\" registered.", name);
497  return;
498 error:
499  FatalError("Fatal error encountered. Exiting...");
500 }
501 
502 /**
503  * \brief Register a streaming data output module.
504  *
505  * This function will register an output module so it can be
506  * configured with the configuration file.
507  *
508  * \retval Returns 0 on success, -1 on failure.
509  */
510 void OutputRegisterStreamingModule(LoggerId id, const char *name, const char *conf_name,
511  OutputInitFunc InitFunc, SCStreamingLogger StreamingLogFunc,
512  enum SCOutputStreamingType stream_type, ThreadInitFunc ThreadInit,
513  ThreadDeinitFunc ThreadDeinit)
514 {
515  if (unlikely(StreamingLogFunc == NULL)) {
516  goto error;
517  }
518 
519  OutputModule *module = SCCalloc(1, sizeof(*module));
520  if (unlikely(module == NULL)) {
521  goto error;
522  }
523 
524  module->logger_id = id;
525  module->name = name;
526  module->conf_name = conf_name;
527  module->InitFunc = InitFunc;
528  module->StreamingLogFunc = StreamingLogFunc;
529  module->stream_type = stream_type;
530  module->ThreadInit = ThreadInit;
531  module->ThreadDeinit = ThreadDeinit;
532  TAILQ_INSERT_TAIL(&output_modules, module, entries);
533 
534  SCLogDebug("Streaming logger \"%s\" registered.", name);
535  return;
536 error:
537  FatalError("Fatal error encountered. Exiting...");
538 }
539 
540 /**
541  * \brief Register a stats data output module.
542  *
543  * This function will register an output module so it can be
544  * configured with the configuration file.
545  *
546  * \retval Returns 0 on success, -1 on failure.
547  */
548 void OutputRegisterStatsModule(LoggerId id, const char *name, const char *conf_name,
549  OutputInitFunc InitFunc, StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit,
550  ThreadDeinitFunc ThreadDeinit)
551 {
552  if (unlikely(StatsLogFunc == NULL)) {
553  goto error;
554  }
555 
556  OutputModule *module = SCCalloc(1, sizeof(*module));
557  if (unlikely(module == NULL)) {
558  goto error;
559  }
560 
561  module->logger_id = id;
562  module->name = name;
563  module->conf_name = conf_name;
564  module->InitFunc = InitFunc;
565  module->StatsLogFunc = StatsLogFunc;
566  module->ThreadInit = ThreadInit;
567  module->ThreadDeinit = ThreadDeinit;
568  TAILQ_INSERT_TAIL(&output_modules, module, entries);
569 
570  SCLogDebug("Stats logger \"%s\" registered.", name);
571  return;
572 error:
573  FatalError("Fatal error encountered. Exiting...");
574 }
575 
576 /**
577  * \brief Register a stats data output sub-module.
578  *
579  * This function will register an output module so it can be
580  * configured with the configuration file.
581  *
582  * \retval Returns 0 on success, -1 on failure.
583  */
584 void OutputRegisterStatsSubModule(LoggerId id, const char *parent_name, const char *name,
585  const char *conf_name, OutputInitSubFunc InitFunc, StatsLogger StatsLogFunc,
586  ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
587 {
588  if (unlikely(StatsLogFunc == NULL)) {
589  goto error;
590  }
591 
592  OutputModule *module = SCCalloc(1, sizeof(*module));
593  if (unlikely(module == NULL)) {
594  goto error;
595  }
596 
597  module->logger_id = id;
598  module->name = name;
599  module->conf_name = conf_name;
600  module->parent_name = parent_name;
601  module->InitSubFunc = InitFunc;
602  module->StatsLogFunc = StatsLogFunc;
603  module->ThreadInit = ThreadInit;
604  module->ThreadDeinit = ThreadDeinit;
605  TAILQ_INSERT_TAIL(&output_modules, module, entries);
606 
607  SCLogDebug("Stats logger \"%s\" registered.", name);
608  return;
609 error:
610  FatalError("Fatal error encountered. Exiting...");
611 }
612 
613 /**
614  * \brief Get an output module by name.
615  *
616  * \retval The OutputModule with the given name or NULL if no output module
617  * with the given name is registered.
618  */
620 {
621  OutputModule *module;
622 
623  TAILQ_FOREACH(module, &output_modules, entries) {
624  if (strcmp(module->conf_name, conf_name) == 0)
625  return module;
626  }
627 
628  return NULL;
629 }
630 
631 static EveJsonSimpleAppLayerLogger *simple_json_applayer_loggers;
632 
633 /**
634  * \brief Deregister all modules. Useful for a memory clean exit.
635  */
637 {
638  OutputModule *module;
639 
640  while ((module = TAILQ_FIRST(&output_modules))) {
641  TAILQ_REMOVE(&output_modules, module, entries);
642  SCFree(module);
643  }
644  SCFree(simple_json_applayer_loggers);
645  simple_json_applayer_loggers = NULL;
646 }
647 
648 static int drop_loggers = 0;
649 
651 {
652  if (drop_loggers)
653  return -1;
654  drop_loggers++;
655  return 0;
656 }
657 
659 {
660  if (drop_loggers)
661  drop_loggers--;
662 }
663 
664 /**
665  * \brief Register a flag for file rotation notification.
666  *
667  * \param flag A pointer that will be set to 1 when file rotation is
668  * requested.
669  */
671 {
672  OutputFileRolloverFlag *flag_entry = SCCalloc(1, sizeof(*flag_entry));
673  if (unlikely(flag_entry == NULL)) {
674  SCLogError("Failed to allocate memory to register file rotation flag");
675  return;
676  }
677  flag_entry->flag = flag;
678  SCMutexLock(&output_file_rotation_mutex);
679  TAILQ_INSERT_TAIL(&output_file_rotation_flags, flag_entry, entries);
680  SCMutexUnlock(&output_file_rotation_mutex);
681 }
682 
683 /**
684  * \brief Unregister a file rotation flag.
685  *
686  * Note that it is safe to call this function with a flag that may not
687  * have been registered, in which case this function won't do
688  * anything.
689  *
690  * \param flag A pointer that has been previously registered for file
691  * rotation notifications.
692  */
694 {
695  OutputFileRolloverFlag *entry, *next;
696  SCMutexLock(&output_file_rotation_mutex);
697  for (entry = TAILQ_FIRST(&output_file_rotation_flags); entry != NULL;
698  entry = next) {
699  next = TAILQ_NEXT(entry, entries);
700  if (entry->flag == flag) {
701  TAILQ_REMOVE(&output_file_rotation_flags, entry, entries);
702  SCMutexUnlock(&output_file_rotation_mutex);
703  SCFree(entry);
704  return;
705  }
706  }
707  SCMutexUnlock(&output_file_rotation_mutex);
708 }
709 
710 /**
711  * \brief Notifies all registered file rotation notification flags.
712  */
714  OutputFileRolloverFlag *flag = NULL;
715  OutputFileRolloverFlag *tflag;
716  SCMutexLock(&output_file_rotation_mutex);
717  TAILQ_FOREACH_SAFE (flag, &output_file_rotation_flags, entries, tflag) {
718  *(flag->flag) = 1;
719  }
720  SCMutexUnlock(&output_file_rotation_mutex);
721 }
722 
723 TmEcode OutputLoggerFlush(ThreadVars *tv, Packet *p, void *thread_data)
724 {
725  LoggerThreadStore *thread_store = (LoggerThreadStore *)thread_data;
726  RootLogger *logger = TAILQ_FIRST(&active_loggers);
727  LoggerThreadStoreNode *thread_store_node = TAILQ_FIRST(thread_store);
728  while (logger && thread_store_node) {
729  if (logger->FlushFunc)
730  logger->FlushFunc(tv, p, thread_store_node->thread_data);
731 
732  logger = TAILQ_NEXT(logger, entries);
733  thread_store_node = TAILQ_NEXT(thread_store_node, entries);
734  }
735  return TM_ECODE_OK;
736 }
737 
738 TmEcode OutputLoggerLog(ThreadVars *tv, Packet *p, void *thread_data)
739 {
740  LoggerThreadStore *thread_store = (LoggerThreadStore *)thread_data;
741  RootLogger *logger = TAILQ_FIRST(&active_loggers);
742  LoggerThreadStoreNode *thread_store_node = TAILQ_FIRST(thread_store);
743  while (logger && thread_store_node) {
744  logger->LogFunc(tv, p, thread_store_node->thread_data);
745 
746  logger = TAILQ_NEXT(logger, entries);
747  thread_store_node = TAILQ_NEXT(thread_store_node, entries);
748  }
749  return TM_ECODE_OK;
750 }
751 
752 TmEcode OutputLoggerThreadInit(ThreadVars *tv, const void *initdata, void **data)
753 {
754  LoggerThreadStore *thread_store = SCCalloc(1, sizeof(*thread_store));
755  if (thread_store == NULL) {
756  return TM_ECODE_FAILED;
757  }
758  TAILQ_INIT(thread_store);
759  *data = (void *)thread_store;
760 
761  RootLogger *logger;
762  TAILQ_FOREACH(logger, &active_loggers, entries) {
763 
764  void *child_thread_data = NULL;
765  if (logger->ThreadInit != NULL) {
766  if (logger->ThreadInit(tv, initdata, &child_thread_data) == TM_ECODE_OK) {
767  LoggerThreadStoreNode *thread_store_node =
768  SCCalloc(1, sizeof(*thread_store_node));
769  if (thread_store_node == NULL) {
770  /* Undo everything, calling de-init will take care
771  * of that. */
772  OutputLoggerThreadDeinit(tv, thread_store);
773  return TM_ECODE_FAILED;
774  }
775  thread_store_node->thread_data = child_thread_data;
776  TAILQ_INSERT_TAIL(thread_store, thread_store_node, entries);
777  }
778  }
779  }
780  return TM_ECODE_OK;
781 }
782 
784 {
785  if (thread_data == NULL)
786  return TM_ECODE_FAILED;
787 
788  LoggerThreadStore *thread_store = (LoggerThreadStore *)thread_data;
789  RootLogger *logger = TAILQ_FIRST(&active_loggers);
790  LoggerThreadStoreNode *thread_store_node = TAILQ_FIRST(thread_store);
791  while (logger && thread_store_node) {
792  if (logger->ThreadDeinit != NULL) {
793  logger->ThreadDeinit(tv, thread_store_node->thread_data);
794  }
795  logger = TAILQ_NEXT(logger, entries);
796  thread_store_node = TAILQ_NEXT(thread_store_node, entries);
797  }
798 
799  /* Free the thread store. */
800  while ((thread_store_node = TAILQ_FIRST(thread_store)) != NULL) {
801  TAILQ_REMOVE(thread_store, thread_store_node, entries);
802  SCFree(thread_store_node);
803  }
804  SCFree(thread_store);
805 
806  return TM_ECODE_OK;
807 }
808 
810  OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc)
811 {
812  BUG_ON(LogFunc == NULL);
813 
814  RootLogger *logger = SCCalloc(1, sizeof(*logger));
815  if (logger == NULL) {
816  FatalError("failed to alloc root logger");
817  }
818  logger->ThreadInit = ThreadInit;
819  logger->ThreadDeinit = ThreadDeinit;
820  logger->LogFunc = LogFunc;
821  logger->ActiveCntFunc = ActiveCntFunc;
822  TAILQ_INSERT_TAIL(&registered_loggers, logger, entries);
823 }
824 
825 static void OutputRegisterActiveLogger(RootLogger *reg)
826 {
827  RootLogger *logger = SCCalloc(1, sizeof(*logger));
828  if (logger == NULL) {
829  FatalError("failed to alloc root logger");
830  }
831  logger->ThreadInit = reg->ThreadInit;
832  logger->ThreadDeinit = reg->ThreadDeinit;
833  logger->LogFunc = reg->LogFunc;
834  logger->ActiveCntFunc = reg->ActiveCntFunc;
835  TAILQ_INSERT_TAIL(&active_loggers, logger, entries);
836 }
837 
839 {
840  RootLogger *logger = TAILQ_FIRST(&registered_loggers);
841  while (logger) {
842  uint32_t cnt = logger->ActiveCntFunc();
843  if (cnt) {
844  OutputRegisterActiveLogger(logger);
845  }
846 
847  logger = TAILQ_NEXT(logger, entries);
848  }
849 }
850 
852 {
853  RootLogger *logger;
854  while ((logger = TAILQ_FIRST(&active_loggers)) != NULL) {
855  TAILQ_REMOVE(&active_loggers, logger, entries);
856  SCFree(logger);
857  }
858 }
859 
861 {
864 }
865 
867 {
868  if (alproto < g_alproto_max) {
869  return &simple_json_applayer_loggers[alproto];
870  }
871  return NULL;
872 }
873 
874 static void RegisterSimpleJsonApplayerLogger(
875  AppProto alproto, EveJsonSimpleTxLogFunc LogTx, const char *name)
876 {
877  simple_json_applayer_loggers[alproto].LogTx = LogTx;
878  if (name) {
879  simple_json_applayer_loggers[alproto].name = name;
880  } else {
881  simple_json_applayer_loggers[alproto].name = AppProtoToString(alproto);
882  }
883 }
884 
885 /**
886  * \brief Register all root loggers.
887  */
889 {
890  simple_json_applayer_loggers = SCCalloc(g_alproto_max, sizeof(EveJsonSimpleAppLayerLogger));
891  if (unlikely(simple_json_applayer_loggers == NULL)) {
892  FatalError("Failed to allocate simple_json_applayer_loggers");
893  }
894  // ALPROTO_HTTP1 special: uses some options flags
895  RegisterSimpleJsonApplayerLogger(ALPROTO_FTP, (EveJsonSimpleTxLogFunc)EveFTPLogCommand, NULL);
896  // ALPROTO_SMTP special: uses state
897  RegisterSimpleJsonApplayerLogger(
899  // no cast here but done in rust for SSHTransaction
900  RegisterSimpleJsonApplayerLogger(ALPROTO_SSH, (EveJsonSimpleTxLogFunc)SCSshLogJson, NULL);
901  // ALPROTO_SMB special: uses state
902  // ALPROTO_DCERPC special: uses state
903  RegisterSimpleJsonApplayerLogger(ALPROTO_DNS, (EveJsonSimpleTxLogFunc)AlertJsonDns, NULL);
904  RegisterSimpleJsonApplayerLogger(ALPROTO_MDNS, (EveJsonSimpleTxLogFunc)AlertJsonMdns, NULL);
905  // either need a cast here or in rust for ModbusTransaction, done here
906  RegisterSimpleJsonApplayerLogger(ALPROTO_MODBUS, (EveJsonSimpleTxLogFunc)SCModbusToJson, NULL);
907  RegisterSimpleJsonApplayerLogger(ALPROTO_ENIP, (EveJsonSimpleTxLogFunc)SCEnipLoggerLog, NULL);
908  RegisterSimpleJsonApplayerLogger(ALPROTO_DNP3, (EveJsonSimpleTxLogFunc)AlertJsonDnp3, NULL);
909  // ALPROTO_NFS special: uses state
910  // underscore instead of dash for ftp_data
911  RegisterSimpleJsonApplayerLogger(
913  RegisterSimpleJsonApplayerLogger(
914  ALPROTO_TFTP, (EveJsonSimpleTxLogFunc)SCTftpLogJsonRequest, NULL);
915  // ALPROTO_IKE special: uses state
916  RegisterSimpleJsonApplayerLogger(
917  ALPROTO_KRB5, (EveJsonSimpleTxLogFunc)SCKrb5LogJsonResponse, NULL);
918  RegisterSimpleJsonApplayerLogger(ALPROTO_QUIC, (EveJsonSimpleTxLogFunc)SCQuicLogJson, NULL);
919  // ALPROTO_DHCP TODO missing
920  RegisterSimpleJsonApplayerLogger(ALPROTO_SIP, (EveJsonSimpleTxLogFunc)SCSipLogJson, NULL);
921  RegisterSimpleJsonApplayerLogger(ALPROTO_RFB, (EveJsonSimpleTxLogFunc)SCRfbJsonLogger, NULL);
922  RegisterSimpleJsonApplayerLogger(ALPROTO_POP3, (EveJsonSimpleTxLogFunc)SCPop3LoggerLog, NULL);
923  RegisterSimpleJsonApplayerLogger(
925  RegisterSimpleJsonApplayerLogger(
927  RegisterSimpleJsonApplayerLogger(
928  ALPROTO_WEBSOCKET, (EveJsonSimpleTxLogFunc)SCWebSocketLoggerLog, NULL);
929  RegisterSimpleJsonApplayerLogger(ALPROTO_LDAP, (EveJsonSimpleTxLogFunc)SCLdapLoggerLog, NULL);
930  RegisterSimpleJsonApplayerLogger(ALPROTO_DOH2, (EveJsonSimpleTxLogFunc)AlertJsonDoh2, NULL);
931  RegisterSimpleJsonApplayerLogger(
932  ALPROTO_TEMPLATE, (EveJsonSimpleTxLogFunc)SCTemplateLoggerLog, NULL);
933  RegisterSimpleJsonApplayerLogger(ALPROTO_RDP, (EveJsonSimpleTxLogFunc)SCRdpToJson, NULL);
934  // special case : http2 is logged in http object
935  RegisterSimpleJsonApplayerLogger(ALPROTO_HTTP2, (EveJsonSimpleTxLogFunc)SCHttp2LogJson, "http");
936  // underscore instead of dash for bittorrent_dht
937  RegisterSimpleJsonApplayerLogger(ALPROTO_BITTORRENT_DHT,
938  (EveJsonSimpleTxLogFunc)SCBittorrentDhtLogger, "bittorrent_dht");
939 
945 }
946 
947 static int JsonGenericLogger(ThreadVars *tv, void *thread_data, const Packet *p, Flow *f,
948  void *state, void *tx, uint64_t tx_id, int dir)
949 {
950  OutputJsonThreadCtx *thread = thread_data;
952  if (al == NULL) {
953  return TM_ECODE_FAILED;
954  }
955 
956  SCJsonBuilder *js = CreateEveHeader(p, dir, al->name, NULL, thread->ctx);
957  if (unlikely(js == NULL)) {
958  return TM_ECODE_FAILED;
959  }
960 
961  if (!al->LogTx(tx, js)) {
962  goto error;
963  }
964 
965  OutputJsonBuilderBuffer(tv, p, p->flow, js, thread);
966  SCJbFree(js);
967 
968  return TM_ECODE_OK;
969 
970 error:
971  SCJbFree(js);
972  return TM_ECODE_FAILED;
973 }
974 
975 static int JsonGenericDirPacketLogger(ThreadVars *tv, void *thread_data, const Packet *p, Flow *f,
976  void *state, void *tx, uint64_t tx_id)
977 {
978  return JsonGenericLogger(tv, thread_data, p, f, state, tx, tx_id, LOG_DIR_PACKET);
979 }
980 
981 static int JsonGenericDirFlowLogger(ThreadVars *tv, void *thread_data, const Packet *p, Flow *f,
982  void *state, void *tx, uint64_t tx_id)
983 {
984  return JsonGenericLogger(tv, thread_data, p, f, state, tx, tx_id, LOG_DIR_FLOW);
985 }
986 
987 #define ARRAY_CAP_STEP 16
988 static EveJsonTxLoggerRegistrationData *preregistered_loggers = NULL;
989 static size_t preregistered_loggers_nb = 0;
990 static size_t preregistered_loggers_cap = 0;
991 
992 // Plugins can preregister logger with this function :
993 // When an app-layer plugin is loaded, it wants to register its logger
994 // But the plugin is loaded before loggers can register
995 // The preregistration data will later be used by OutputRegisterLoggers
997 {
998  if (preregistered_loggers_nb == preregistered_loggers_cap) {
999  void *tmp = SCRealloc(
1000  preregistered_loggers, sizeof(EveJsonTxLoggerRegistrationData) *
1001  (preregistered_loggers_cap + ARRAY_CAP_STEP));
1002  if (tmp == NULL) {
1003  return 1;
1004  }
1005  preregistered_loggers_cap += ARRAY_CAP_STEP;
1006  preregistered_loggers = tmp;
1007  }
1008  preregistered_loggers[preregistered_loggers_nb] = reg_data;
1009  preregistered_loggers_nb++;
1010  return 0;
1011 }
1012 
1013 static TxLogger JsonLoggerFromDir(uint8_t dir)
1014 {
1015  if (dir == LOG_DIR_PACKET) {
1016  return JsonGenericDirPacketLogger;
1017  }
1018  BUG_ON(dir != LOG_DIR_FLOW);
1019  return JsonGenericDirFlowLogger;
1020 }
1021 
1022 /**
1023  * \brief Register all non-root logging modules.
1024  */
1026 {
1027  /* custom format log*/
1029 
1030  LuaLogRegister();
1031  /* fast log */
1033  /* debug log */
1035  /* syslog log */
1039  /* json log */
1041  /* email logs */
1043  /* http log */
1046  OutputRegisterTxSubModuleWithProgress(LOGGER_JSON_TX, "eve-log", "LogHttp2Log", "eve-log.http2",
1047  OutputJsonLogInitSub, ALPROTO_HTTP2, JsonGenericDirFlowLogger, HTTP2StateClosed,
1048  HTTP2StateClosed, JsonLogThreadInit, JsonLogThreadDeinit);
1049  /* tls log */
1053  /* ssh */
1054  OutputRegisterTxSubModuleWithCondition(LOGGER_JSON_TX, "eve-log", "JsonSshLog", "eve-log.ssh",
1055  OutputJsonLogInitSub, ALPROTO_SSH, JsonGenericDirFlowLogger, SSHTxLogCondition,
1057  /* pcap log */
1058  PcapLogRegister();
1059  /* file log */
1062  /* dns */
1064  /* mdns */
1066  /* modbus */
1067  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonModbusLog", "eve-log.modbus",
1068  OutputJsonLogInitSub, ALPROTO_MODBUS, JsonGenericDirFlowLogger, JsonLogThreadInit,
1070 
1071  SCLogDebug("modbus json logger registered.");
1072  /* tcp streaming data */
1074  /* log stats */
1076 
1079  /* flow/netflow */
1082  /* json stats */
1084 
1085  /* DNP3. */
1088 
1089  /* NFS JSON logger. */
1091  /* TFTP JSON logger. */
1092  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonTFTPLog", "eve-log.tftp",
1093  OutputJsonLogInitSub, ALPROTO_TFTP, JsonGenericDirPacketLogger, JsonLogThreadInit,
1095 
1096  SCLogDebug("TFTP JSON logger registered.");
1097  /* FTP and FTP-DATA JSON loggers. */
1098  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonFTPLog", "eve-log.ftp",
1099  OutputJsonLogInitSub, ALPROTO_FTP, JsonGenericDirFlowLogger, JsonLogThreadInit,
1101  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonFTPLog", "eve-log.ftp",
1102  OutputJsonLogInitSub, ALPROTO_FTPDATA, JsonGenericDirFlowLogger, JsonLogThreadInit,
1104  SCLogDebug("FTP JSON logger registered.");
1105 
1106  /* SMB JSON logger. */
1108  /* IKE JSON logger. */
1110  /* KRB5 JSON logger. */
1111  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonKRB5Log", "eve-log.krb5",
1112  OutputJsonLogInitSub, ALPROTO_KRB5, JsonGenericDirPacketLogger, JsonLogThreadInit,
1114 
1115  SCLogDebug("KRB5 JSON logger registered.");
1116  /* QUIC JSON logger. */
1117  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonQuicLog", "eve-log.quic",
1118  OutputJsonLogInitSub, ALPROTO_QUIC, JsonGenericDirPacketLogger, JsonLogThreadInit,
1120 
1121  SCLogDebug("quic json logger registered.");
1122  /* DHCP JSON logger. */
1124 
1125  /* SIP JSON logger. */
1126  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonSIPLog", "eve-log.sip",
1127  OutputJsonLogInitSub, ALPROTO_SIP, JsonGenericDirPacketLogger, JsonLogThreadInit,
1129 
1130  SCLogDebug("SIP JSON logger registered.");
1131  /* RFB JSON logger. */
1132  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonRFBLog", "eve-log.rfb",
1133  OutputJsonLogInitSub, ALPROTO_RFB, JsonGenericDirPacketLogger, JsonLogThreadInit,
1135  /* MQTT JSON logger. */
1137  /* Pgsql JSON logger. */
1139  /* WebSocket JSON logger. */
1140  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonWebSocketLog", "eve-log.websocket",
1141  OutputJsonLogInitSub, ALPROTO_WEBSOCKET, JsonGenericDirPacketLogger, JsonLogThreadInit,
1143  /* Enip JSON logger. */
1144  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonEnipLog", "eve-log.enip",
1145  OutputJsonLogInitSub, ALPROTO_ENIP, JsonGenericDirFlowLogger, JsonLogThreadInit,
1147  /* Ldap JSON logger. */
1148  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonLdapLog", "eve-log.ldap",
1149  OutputJsonLogInitSub, ALPROTO_LDAP, JsonGenericDirFlowLogger, JsonLogThreadInit,
1151  /* DoH2 JSON logger. */
1153  /* POP3 JSON logger */
1154  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonPop3Log", "eve-log.pop3",
1155  OutputJsonLogInitSub, ALPROTO_POP3, JsonGenericDirFlowLogger, JsonLogThreadInit,
1157  /* Mdns JSON logger. */
1158  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonMdnsLog", "eve-log.template",
1159  OutputJsonLogInitSub, ALPROTO_MDNS, JsonGenericDirPacketLogger, JsonLogThreadInit,
1161  /* Template JSON logger. */
1162  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonTemplateLog", "eve-log.template",
1163  OutputJsonLogInitSub, ALPROTO_TEMPLATE, JsonGenericDirPacketLogger, JsonLogThreadInit,
1165  /* RDP JSON logger. */
1166  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonRdpLog", "eve-log.rdp",
1167  OutputJsonLogInitSub, ALPROTO_RDP, JsonGenericDirPacketLogger, JsonLogThreadInit,
1169  SCLogDebug("rdp json logger registered.");
1170  /* DCERPC JSON logger. */
1172  /* app layer frames */
1174  /* BitTorrent DHT JSON logger */
1175  if (SCConfGetNode("app-layer.protocols.bittorrent-dht") != NULL) {
1176  /* Register as an eve sub-module. */
1177  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", "JsonBitTorrentDHTLog",
1178  "eve-log.bittorrent-dht", OutputJsonLogInitSub, ALPROTO_BITTORRENT_DHT,
1179  JsonGenericDirPacketLogger, JsonLogThreadInit, JsonLogThreadDeinit);
1180  }
1181  /* ARP JSON logger */
1183 
1184  for (size_t i = 0; i < preregistered_loggers_nb; i++) {
1185  OutputRegisterTxSubModule(LOGGER_JSON_TX, "eve-log", preregistered_loggers[i].logname,
1186  preregistered_loggers[i].confname, OutputJsonLogInitSub,
1187  preregistered_loggers[i].alproto, JsonLoggerFromDir(preregistered_loggers[i].dir),
1189  SCLogDebug(
1190  "%s JSON logger registered.", AppProtoToString(preregistered_loggers[i].alproto));
1191  RegisterSimpleJsonApplayerLogger(preregistered_loggers[i].alproto,
1192  (EveJsonSimpleTxLogFunc)preregistered_loggers[i].LogTx, NULL);
1193  }
1194 }
RootLogger_::ThreadDeinit
ThreadDeinitFunc ThreadDeinit
Definition: output.c:92
log-stats.h
JsonMQTTAddMetadata
bool JsonMQTTAddMetadata(void *vtx, SCJsonBuilder *js)
Definition: output-json-mqtt.c:63
OutputModule_::parent_name
const char * parent_name
Definition: output.h:61
OutputFileRolloverFlag
OutputFileRolloverFlag
Definition: output.c:128
LogTlsStoreRegister
void LogTlsStoreRegister(void)
Definition: log-tlsstore.c:437
tm-threads.h
OutputModule_::FileLogFunc
SCFileLogger FileLogFunc
Definition: output.h:73
output-json-ftp.h
OutputDropLoggerEnable
int OutputDropLoggerEnable(void)
Definition: output.c:650
OutputRegisterStreamingModule
void OutputRegisterStreamingModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, SCStreamingLogger StreamingLogFunc, enum SCOutputStreamingType stream_type, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a streaming data output module.
Definition: output.c:510
LoggerThreadStoreNode
LoggerThreadStoreNode
Definition: output.c:112
OutputLogFunc
TmEcode(* OutputLogFunc)(ThreadVars *, Packet *, void *)
Definition: output.h:53
JsonDoh2LogRegister
void JsonDoh2LogRegister(void)
Definition: output-json-dns.c:677
app-layer-ssh.h
JsonDCERPCLogRegister
void JsonDCERPCLogRegister(void)
Definition: output-json-dcerpc.c:67
OutputTxLoggerRegister
void OutputTxLoggerRegister(void)
Definition: output-tx.c:648
alert-debuglog.h
TAILQ_INIT
#define TAILQ_INIT(head)
Definition: queue.h:262
JsonPgsqlLogRegister
void JsonPgsqlLogRegister(void)
Definition: output-json-pgsql.c:184
ALPROTO_DNS
@ ALPROTO_DNS
Definition: app-layer-protos.h:47
OutputJsonThreadCtx_::ctx
OutputJsonCtx * ctx
Definition: output-json.h:84
JsonTlsLogJSONExtended
bool JsonTlsLogJSONExtended(void *vtx, SCJsonBuilder *tjs)
Definition: output-json-tls.c:498
OutputModule_::PacketFlushFunc
PacketLogger PacketFlushFunc
Definition: output.h:69
ALPROTO_ENIP
@ ALPROTO_ENIP
Definition: app-layer-protos.h:49
OutputRegisterTxSubModuleWithProgress
void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Definition: output.c:359
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
EveFTPDataAddMetadata
bool EveFTPDataAddMetadata(void *vtx, SCJsonBuilder *jb)
Definition: app-layer-ftp.c:1379
JsonSMBLogRegister
void JsonSMBLogRegister(void)
Definition: output-json-smb.c:151
ALPROTO_TLS
@ ALPROTO_TLS
Definition: app-layer-protos.h:39
OutputRegisterRootLogger
void OutputRegisterRootLogger(ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc)
Definition: output.c:809
output-json-mqtt.h
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:270
output-eve-stream.h
OutputFileLoggerRegister
void OutputFileLoggerRegister(void)
Definition: output-file.c:235
RootLogger_::FlushFunc
OutputFlushFunc FlushFunc
Definition: output.c:90
next
struct HtpBodyChunk_ * next
Definition: app-layer-htp.h:0
OutputPacketLoggerFunctions_::FlushFunc
PacketLogger FlushFunc
Definition: output.h:89
ALPROTO_MODBUS
@ ALPROTO_MODBUS
Definition: app-layer-protos.h:48
AppProto
uint16_t AppProto
Definition: app-layer-protos.h:86
ALPROTO_QUIC
@ ALPROTO_QUIC
Definition: app-layer-protos.h:57
SCFileLogger
int(* SCFileLogger)(ThreadVars *, void *thread_data, const Packet *, const File *, void *tx, const uint64_t tx_id, uint8_t direction)
Definition: output-file.h:48
ALPROTO_POP3
@ ALPROTO_POP3
Definition: app-layer-protos.h:71
SCEveJsonSimpleGetLogger
EveJsonSimpleAppLayerLogger * SCEveJsonSimpleGetLogger(AppProto alproto)
Definition: output.c:866
CreateEveHeader
SCJsonBuilder * CreateEveHeader(const Packet *p, enum SCOutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, OutputJsonCtx *eve_ctx)
Definition: output-json.c:834
JsonLogThreadInit
TmEcode JsonLogThreadInit(ThreadVars *t, const void *initdata, void **data)
Definition: output-json-common.c:99
OutputModule_::name
const char * name
Definition: output.h:59
Flow_
Flow data structure.
Definition: flow.h:356
LogTlsLogRegister
void LogTlsLogRegister(void)
Definition: log-tlslog.c:499
OutputModule_::logger_id
LoggerId logger_id
Definition: output.h:58
LoggerId
LoggerId
Definition: suricata-common.h:477
AppProtoToString
const char * AppProtoToString(AppProto alproto)
Maps the ALPROTO_*, to its string equivalent.
Definition: app-layer-protos.c:40
AlertFastLogRegister
void AlertFastLogRegister(void)
Definition: alert-fastlog.c:77
output-json-pgsql.h
JsonFileLogRegister
void JsonFileLogRegister(void)
Definition: output-json-file.c:352
AlertJsonDns
bool AlertJsonDns(void *txptr, SCJsonBuilder *js)
Definition: output-json-dns.c:251
output-json-frame.h
OutputModule_::ts_log_progress
int ts_log_progress
Definition: output.h:81
OutputRegisterStatsSubModule
void OutputRegisterStatsSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a stats data output sub-module.
Definition: output.c:584
output-json-netflow.h
JsonDNP3LogRegister
void JsonDNP3LogRegister(void)
Definition: output-json-dnp3.c:366
LogCustomFormatRegister
void LogCustomFormatRegister(void)
Definition: log-cf-common.c:271
SCOutputEvePreRegisterLogger
int SCOutputEvePreRegisterLogger(EveJsonTxLoggerRegistrationData reg_data)
Definition: output.c:996
TAILQ_FOREACH
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:252
output-json-arp.h
OutputGetModuleByConfName
OutputModule * OutputGetModuleByConfName(const char *conf_name)
Get an output module by name.
Definition: output.c:619
output-json-tls.h
OutputInitFunc
OutputInitResult(* OutputInitFunc)(SCConfNode *)
Definition: output.h:51
SSHTxLogCondition
bool SSHTxLogCondition(ThreadVars *tv, const Packet *p, void *state, void *tx, uint64_t tx_id)
Definition: app-layer-ssh.c:76
ALPROTO_SIP
@ ALPROTO_SIP
Definition: app-layer-protos.h:59
OutputRegisterTxSubModule
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)
Definition: output.c:384
OutputSetupActiveLoggers
void OutputSetupActiveLoggers(void)
Definition: output.c:838
AlertSyslogRegister
void AlertSyslogRegister(void)
Function to register the AlertSyslog module.
Definition: alert-syslog.c:384
OutputModule_::StatsLogFunc
StatsLogger StatsLogFunc
Definition: output.h:77
SCMutexLock
#define SCMutexLock(mut)
Definition: threads-debug.h:117
ALPROTO_LDAP
@ ALPROTO_LDAP
Definition: app-layer-protos.h:65
JsonDHCPLogRegister
void JsonDHCPLogRegister(void)
Definition: output-json-dhcp.c:145
TxLogger
int(* TxLogger)(ThreadVars *, void *thread_data, const Packet *, Flow *f, void *state, void *tx, uint64_t tx_id)
Transaction logger function pointer type.
Definition: output-tx.h:34
FlowLogger
int(* FlowLogger)(ThreadVars *, void *thread_data, Flow *f)
Flow logger function pointer type.
Definition: output-flow.h:36
ALPROTO_FTP
@ ALPROTO_FTP
Definition: app-layer-protos.h:37
SCMUTEX_INITIALIZER
#define SCMUTEX_INITIALIZER
Definition: threads-debug.h:121
OutputJsonBuilderBuffer
void OutputJsonBuilderBuffer(ThreadVars *tv, const Packet *p, Flow *f, SCJsonBuilder *js, OutputJsonThreadCtx *ctx)
Definition: output-json.c:999
TAILQ_INSERT_TAIL
#define TAILQ_INSERT_TAIL(head, elm, field)
Definition: queue.h:294
PcapLogRegister
void PcapLogRegister(void)
Definition: log-pcap.c:219
OutputModule_::InitSubFunc
OutputInitSubFunc InitSubFunc
Definition: output.h:63
OutputRegisterFiledataModule
void OutputRegisterFiledataModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, SCFiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a file data output module.
Definition: output.c:437
SCFiledataLogger
int(* SCFiledataLogger)(ThreadVars *, void *thread_data, const Packet *, File *, void *tx, const uint64_t tx_id, const uint8_t *, uint32_t, uint8_t, uint8_t dir)
File-data logger function pointer type.
Definition: output-filedata.h:51
ALPROTO_SSH
@ ALPROTO_SSH
Definition: app-layer-protos.h:40
app-layer-ftp.h
OutputModule_::PacketLogFunc
PacketLogger PacketLogFunc
Definition: output.h:68
TM_ECODE_FAILED
@ TM_ECODE_FAILED
Definition: tm-threads-common.h:82
OutputModule_::FiledataLogFunc
SCFiledataLogger FiledataLogFunc
Definition: output.h:74
JsonStatsLogRegister
void JsonStatsLogRegister(void)
Definition: output-json-stats.c:501
LogTcpDataLogRegister
void LogTcpDataLogRegister(void)
Definition: log-tcp-data.c:46
OutputRegisterRootLoggers
void OutputRegisterRootLoggers(void)
Register all root loggers.
Definition: output.c:888
OutputLoggerThreadDeinit
TmEcode OutputLoggerThreadDeinit(ThreadVars *tv, void *thread_data)
Definition: output.c:783
OutputRegisterTxModule
void OutputRegisterTxModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a tx output module.
Definition: output.c:376
OutputModule_::alproto
AppProto alproto
Definition: output.h:78
JsonTlsLogRegister
void JsonTlsLogRegister(void)
Definition: output-json-tls.c:707
OutputRegisterFileSubModule
void OutputRegisterFileSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, SCFileLogger FileLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a file output sub-module.
Definition: output.c:400
alert-syslog.h
JsonFlowLogRegister
void JsonFlowLogRegister(void)
Definition: output-json-flow.c:440
OutputPacketLoggerFunctions_::ConditionFunc
PacketLogCondition ConditionFunc
Definition: output.h:90
TmModuleLoggerRegister
void TmModuleLoggerRegister(void)
Definition: output.c:860
output-json-dcerpc.h
TM_ECODE_OK
@ TM_ECODE_OK
Definition: tm-threads-common.h:81
JsonPgsqlAddMetadata
bool JsonPgsqlAddMetadata(void *vtx, SCJsonBuilder *jb)
Definition: output-json-pgsql.c:62
OutputJsonRegister
void OutputJsonRegister(void)
Definition: output-json.c:83
OutputClearActiveLoggers
void OutputClearActiveLoggers(void)
Definition: output.c:851
ALPROTO_KRB5
@ ALPROTO_KRB5
Definition: app-layer-protos.h:56
OutputJsonThreadCtx_
Definition: output-json.h:83
TAILQ_ENTRY
#define TAILQ_ENTRY(type)
Definition: queue.h:239
RootLogger_::LogFunc
OutputLogFunc LogFunc
Definition: output.c:89
output-json-dnp3.h
OutputRegisterFileRotationFlag
void OutputRegisterFileRotationFlag(int *flag)
Register a flag for file rotation notification.
Definition: output.c:670
OutputJsonLogInitSub
OutputInitResult OutputJsonLogInitSub(SCConfNode *conf, OutputCtx *parent_ctx)
Definition: output-json-common.c:82
LogHttpLogRegister
void LogHttpLogRegister(void)
Definition: log-httplog.c:65
OutputRegisterFlowSubModule
void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, FlowLogger FlowLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a flow output sub-module.
Definition: output.c:473
OutputModule_::stream_type
enum SCOutputStreamingType stream_type
Definition: output.h:79
OutputModule_::ThreadInit
ThreadInitFunc ThreadInit
Definition: output.h:65
OutputRegisterTxModuleWithCondition
void OutputRegisterTxModuleWithCondition(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a tx output module with condition.
Definition: output.c:327
TAILQ_HEAD_INITIALIZER
#define TAILQ_HEAD_INITIALIZER(head)
Definition: queue.h:236
output_modules
OutputModuleList output_modules
JsonAnomalyLogRegister
void JsonAnomalyLogRegister(void)
Definition: output-json-anomaly.c:456
TAILQ_REMOVE
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:312
util-debug.h
output-json-flow.h
TAILQ_FIRST
#define TAILQ_FIRST(head)
Definition: queue.h:250
OutputStreamingLoggerRegister
void OutputStreamingLoggerRegister(void)
Definition: output-streaming.c:432
util-error.h
OutputRegisterStatsModule
void OutputRegisterStatsModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a stats data output module.
Definition: output.c:548
log-tcp-data.h
g_alproto_max
AppProto g_alproto_max
Definition: app-layer-protos.c:29
OutputModule_::ThreadDeinit
ThreadDeinitFunc ThreadDeinit
Definition: output.h:66
ALPROTO_DNP3
@ ALPROTO_DNP3
Definition: app-layer-protos.h:50
output-json.h
SCMutexUnlock
#define SCMutexUnlock(mut)
Definition: threads-debug.h:119
OutputRegisterTxModuleWithProgress
void OutputRegisterTxModuleWithProgress(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Register a tx output module with progress.
Definition: output.c:351
output-json-file.h
OutputRegisterModule
void OutputRegisterModule(const char *, const char *, OutputInitFunc)
JsonIKELogRegister
void JsonIKELogRegister(void)
Definition: output-json-ike.c:182
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:58
JsonMdnsLogRegister
void JsonMdnsLogRegister(void)
Definition: output-json-mdns.c:155
ThreadInitFunc
TmEcode(* ThreadInitFunc)(ThreadVars *, const void *, void **)
Definition: tm-modules.h:39
OutputModule_::StreamingLogFunc
SCStreamingLogger StreamingLogFunc
Definition: output.h:76
log-tlslog.h
OutputLoggerThreadInit
TmEcode OutputLoggerThreadInit(ThreadVars *tv, const void *initdata, void **data)
Definition: output.c:752
LOG_DIR_FLOW
@ LOG_DIR_FLOW
Definition: output-eve-bindgen.h:33
app-layer-parser.h
JsonMQTTLogRegister
void JsonMQTTLogRegister(void)
Definition: output-json-mqtt.c:192
BUG_ON
#define BUG_ON(x)
Definition: suricata-common.h:317
OutputFilestoreRegister
void OutputFilestoreRegister(void)
Definition: output-filestore.c:503
OutputFlushFunc
TmEcode(* OutputFlushFunc)(ThreadVars *, Packet *, void *)
Definition: output.h:54
OutputRegisterLoggers
void OutputRegisterLoggers(void)
Register all non-root logging modules.
Definition: output.c:1025
OutputModule_::conf_name
const char * conf_name
Definition: output.h:60
output-json-anomaly.h
OutputModule_::FlowLogFunc
FlowLogger FlowLogFunc
Definition: output.h:75
OutputDeregisterAll
void OutputDeregisterAll(void)
Deregister all modules. Useful for a memory clean exit.
Definition: output.c:636
Packet_
Definition: decode.h:492
RootLogger_::ActiveCntFunc
OutputGetActiveCountFunc ActiveCntFunc
Definition: output.c:93
OutputPacketLoggerRegister
void OutputPacketLoggerRegister(void)
Definition: output-packet.c:194
EveJsonTxLoggerRegistrationData
Definition: output-eve-bindgen.h:47
output-eve-bindgen.h
ALPROTO_RDP
@ ALPROTO_RDP
Definition: app-layer-protos.h:68
conf.h
OutputNotifyFileRotation
void OutputNotifyFileRotation(void)
Notifies all registered file rotation notification flags.
Definition: output.c:713
TAILQ_HEAD
typedef TAILQ_HEAD(LoggerThreadStore_, LoggerThreadStoreNode_)
Definition: output.c:114
TmEcode
TmEcode
Definition: tm-threads-common.h:80
ALPROTO_DOH2
@ ALPROTO_DOH2
Definition: app-layer-protos.h:66
name
const char * name
Definition: tm-threads.c:2123
EveStreamLogRegister
void EveStreamLogRegister(void)
Definition: output-eve-stream.c:453
ALPROTO_TFTP
@ ALPROTO_TFTP
Definition: app-layer-protos.h:54
RootLogger_::ThreadInit
ThreadInitFunc ThreadInit
Definition: output.c:91
ALPROTO_HTTP2
@ ALPROTO_HTTP2
Definition: app-layer-protos.h:69
EveJsonSimpleAppLayerLogger
Definition: output-eve-bindgen.h:40
TAILQ_FOREACH_SAFE
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
Definition: queue.h:329
log-pcap.h
SCRealloc
#define SCRealloc(ptr, sz)
Definition: util-mem.h:50
alert-fastlog.h
TxLoggerCondition
bool(* TxLoggerCondition)(ThreadVars *, const Packet *, void *state, void *tx, uint64_t tx_id)
Transaction logger condition function pointer type.
Definition: output-tx.h:41
LogStatsLogRegister
void LogStatsLogRegister(void)
Definition: log-stats.c:285
OutputPacketLoggerFunctions_::ThreadDeinitFunc
ThreadDeinitFunc ThreadDeinitFunc
Definition: output.h:92
JsonFrameLogRegister
void JsonFrameLogRegister(void)
Definition: output-json-frame.c:565
cnt
uint32_t cnt
Definition: tmqh-packetpool.h:7
Packet_::flow
struct Flow_ * flow
Definition: decode.h:537
OutputModule_::TxLogCondition
TxLoggerCondition TxLogCondition
Definition: output.h:72
suricata-common.h
output-json-stats.h
EveJsonSimpleAppLayerLogger::LogTx
EveJsonSimpleTxLogFunc LogTx
Definition: output-eve-bindgen.h:41
ARRAY_CAP_STEP
#define ARRAY_CAP_STEP
Definition: output.c:987
output-json-nfs.h
ALPROTO_PGSQL
@ ALPROTO_PGSQL
Definition: app-layer-protos.h:62
TAILQ_NEXT
#define TAILQ_NEXT(elm, field)
Definition: queue.h:307
OutputPacketLoggerFunctions_::LogFunc
PacketLogger LogFunc
Definition: output.h:88
OutputRegisterPacketModule
void OutputRegisterPacketModule(LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, OutputPacketLoggerFunctions *output_module_functions)
Register a packet output module.
Definition: output.c:174
ALPROTO_FTPDATA
@ ALPROTO_FTPDATA
Definition: app-layer-protos.h:53
output-filestore.h
output-json-mdns.h
FatalError
#define FatalError(...)
Definition: util-debug.h:503
LuaLogRegister
void LuaLogRegister(void)
Definition: output-lua.c:907
ALPROTO_WEBSOCKET
@ ALPROTO_WEBSOCKET
Definition: app-layer-protos.h:64
OutputRegisterPacketSubModule
void OutputRegisterPacketSubModule(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, OutputPacketLoggerFunctions *output_logger_functions)
Register a packet output sub-module.
Definition: output.c:212
JsonSmtpLogRegister
void JsonSmtpLogRegister(void)
Definition: output-json-smtp.c:192
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
log-httplog.h
JsonMetadataLogRegister
void JsonMetadataLogRegister(void)
Definition: output-json-metadata.c:95
output-json-alert.h
OutputModule_::PacketConditionFunc
PacketLogCondition PacketConditionFunc
Definition: output.h:70
RootLogger
struct RootLogger_ RootLogger
output-json-dns.h
OutputGetActiveCountFunc
uint32_t(* OutputGetActiveCountFunc)(void)
Definition: output.h:55
OutputPacketLoggerFunctions_::ThreadInitFunc
ThreadInitFunc ThreadInitFunc
Definition: output.h:91
log-cf-common.h
output-json-metadata.h
LOGGER_JSON_TX
@ LOGGER_JSON_TX
Definition: suricata-common.h:485
EveJsonSimpleAppLayerLogger::name
const char * name
Definition: output-eve-bindgen.h:42
JsonDnsLogRegister
void JsonDnsLogRegister(void)
Definition: output-json-dns.c:670
EveFTPLogCommand
bool EveFTPLogCommand(void *vtx, SCJsonBuilder *jb)
Definition: output-json-ftp.c:49
SCConfGetNode
SCConfNode * SCConfGetNode(const char *name)
Get a SCConfNode by name.
Definition: conf.c:181
SCLogError
#define SCLogError(...)
Macro used to log ERROR messages.
Definition: util-debug.h:262
OutputLoggerLog
TmEcode OutputLoggerLog(ThreadVars *tv, Packet *p, void *thread_data)
Definition: output.c:738
SCFree
#define SCFree(p)
Definition: util-mem.h:61
output-json-dhcp.h
OutputLoggerFlush
TmEcode OutputLoggerFlush(ThreadVars *tv, Packet *p, void *thread_data)
Definition: output.c:723
ALPROTO_MDNS
@ ALPROTO_MDNS
Definition: app-layer-protos.h:72
JsonDropLogRegister
void JsonDropLogRegister(void)
Definition: output-json-drop.c:391
output-json-ike.h
StatsLogger
int(* StatsLogger)(ThreadVars *, void *thread_data, const StatsTable *)
Definition: output-stats.h:50
OutputModule_::TxLogFunc
TxLogger TxLogFunc
Definition: output.h:71
ALPROTO_MQTT
@ ALPROTO_MQTT
Definition: app-layer-protos.h:61
OutputModule_::tc_log_progress
int tc_log_progress
Definition: output.h:80
AlertJsonDnp3
bool AlertJsonDnp3(void *vtx, SCJsonBuilder *js)
Definition: output-json-dnp3.c:213
ALPROTO_TEMPLATE
@ ALPROTO_TEMPLATE
Definition: app-layer-protos.h:67
output-lua.h
ALPROTO_RFB
@ ALPROTO_RFB
Definition: app-layer-protos.h:60
LOG_DIR_PACKET
@ LOG_DIR_PACKET
Definition: output-eve-bindgen.h:32
JsonHttpLogRegister
void JsonHttpLogRegister(void)
Definition: output-json-http.c:644
ALPROTO_BITTORRENT_DHT
@ ALPROTO_BITTORRENT_DHT
Definition: app-layer-protos.h:70
output-json-smb.h
JsonArpLogRegister
void JsonArpLogRegister(void)
Definition: output-json-arp.c:104
id
uint32_t id
Definition: detect-flowbits.c:933
SCOutputStreamingType
SCOutputStreamingType
Definition: output-streaming.h:35
AlertJsonMdns
bool AlertJsonMdns(void *txptr, SCJsonBuilder *js)
Definition: output-json-mdns.c:42
output-json-smtp.h
JsonLogThreadDeinit
TmEcode JsonLogThreadDeinit(ThreadVars *t, void *data)
Definition: output-json-common.c:132
output-json-http.h
flow.h
OutputModule_
Definition: output.h:57
AlertDebugLogRegister
void AlertDebugLogRegister(void)
Definition: alert-debuglog.c:481
OutputUnregisterFileRotationFlag
void OutputUnregisterFileRotationFlag(int *flag)
Unregister a file rotation flag.
Definition: output.c:693
OutputRegisterTxSubModuleWithCondition
void OutputRegisterTxSubModuleWithCondition(LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
Definition: output.c:335
log-tlsstore.h
Flow_::alproto
AppProto alproto
application level protocol
Definition: flow.h:450
EveJsonSimpleTxLogFunc
bool(* EveJsonSimpleTxLogFunc)(const void *, void *)
Definition: output-eve-bindgen.h:38
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
OutputFiledataLoggerRegister
void OutputFiledataLoggerRegister(void)
Definition: output-filedata.c:269
AlertJsonDoh2
bool AlertJsonDoh2(void *txptr, SCJsonBuilder *js)
Definition: output-json-dns.c:257
OutputPacketLoggerFunctions_
Definition: output.h:87
SCMutex
#define SCMutex
Definition: threads-debug.h:114
OutputInitSubFunc
OutputInitResult(* OutputInitSubFunc)(SCConfNode *, OutputCtx *)
Definition: output.h:52
SCStreamingLogger
int(* SCStreamingLogger)(ThreadVars *, void *thread_data, const Flow *f, const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t flags)
Definition: output-streaming.h:41
output.h
JsonAlertLogRegister
void JsonAlertLogRegister(void)
Definition: output-json-alert.c:1100
JsonNFSLogRegister
void JsonNFSLogRegister(void)
Definition: output-json-nfs.c:109
OutputDropLoggerDisable
void OutputDropLoggerDisable(void)
Definition: output.c:658
JsonNetFlowLogRegister
void JsonNetFlowLogRegister(void)
Definition: output-json-netflow.c:308
ThreadDeinitFunc
TmEcode(* ThreadDeinitFunc)(ThreadVars *, void *)
Definition: tm-modules.h:40
OutputModule_::InitFunc
OutputInitFunc InitFunc
Definition: output.h:62
RootLogger_
Definition: output.c:88
output-json-drop.h