suricata
output-json-alert.c File Reference
#include "suricata-common.h"
#include "debug.h"
#include "detect.h"
#include "flow.h"
#include "conf.h"
#include "threads.h"
#include "tm-threads.h"
#include "threadvars.h"
#include "util-debug.h"
#include "util-misc.h"
#include "util-unittest.h"
#include "util-unittest-helper.h"
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-reference.h"
#include "detect-metadata.h"
#include "app-layer-parser.h"
#include "app-layer-dnp3.h"
#include "app-layer-htp.h"
#include "app-layer-htp-xff.h"
#include "app-layer-ftp.h"
#include "util-classification-config.h"
#include "util-syslog.h"
#include "util-logopenfile.h"
#include "output.h"
#include "output-json.h"
#include "output-json-alert.h"
#include "output-json-dnp3.h"
#include "output-json-dns.h"
#include "output-json-http.h"
#include "output-json-tls.h"
#include "output-json-ssh.h"
#include "output-json-smtp.h"
#include "output-json-email-common.h"
#include "output-json-nfs.h"
#include "output-json-smb.h"
#include "output-json-flow.h"
#include "output-json-sip.h"
#include "output-json-rfb.h"
#include "util-byte.h"
#include "util-privs.h"
#include "util-print.h"
#include "util-proto-name.h"
#include "util-optimize.h"
#include "util-buffer.h"
#include "util-crypt.h"
#include "util-validate.h"
Include dependency graph for output-json-alert.c:

Go to the source code of this file.

Data Structures

struct  AlertJsonOutputCtx_
 
struct  JsonAlertLogThread_
 

Macros

#define MODULE_NAME   "JsonAlertLog"
 
#define LOG_JSON_PAYLOAD   BIT_U16(0)
 
#define LOG_JSON_PACKET   BIT_U16(1)
 
#define LOG_JSON_PAYLOAD_BASE64   BIT_U16(2)
 
#define LOG_JSON_TAGGED_PACKETS   BIT_U16(3)
 
#define LOG_JSON_APP_LAYER   BIT_U16(4)
 
#define LOG_JSON_FLOW   BIT_U16(5)
 
#define LOG_JSON_HTTP_BODY   BIT_U16(6)
 
#define LOG_JSON_HTTP_BODY_BASE64   BIT_U16(7)
 
#define LOG_JSON_RULE_METADATA   BIT_U16(8)
 
#define LOG_JSON_RULE   BIT_U16(9)
 
#define METADATA_DEFAULTS
 
#define JSON_BODY_LOGGING   (LOG_JSON_HTTP_BODY | LOG_JSON_HTTP_BODY_BASE64)
 
#define JSON_STREAM_BUFFER_SIZE   4096
 
#define DEFAULT_LOG_FILENAME   "alert.json"
 

Typedefs

typedef struct AlertJsonOutputCtx_ AlertJsonOutputCtx
 
typedef struct JsonAlertLogThread_ JsonAlertLogThread
 

Functions

void AlertJsonHeader (void *ctx, const Packet *p, const PacketAlert *pa, json_t *js, uint16_t flags)
 
void JsonAlertLogRegister (void)
 

Detailed Description

Author
Tom DeCanio td@np.nosp@m.ulse.nosp@m.tech..nosp@m.com

Logs alerts in JSON format.

Definition in file output-json-alert.c.

Macro Definition Documentation

◆ DEFAULT_LOG_FILENAME

#define DEFAULT_LOG_FILENAME   "alert.json"

Definition at line 805 of file output-json-alert.c.

◆ JSON_BODY_LOGGING

#define JSON_BODY_LOGGING   (LOG_JSON_HTTP_BODY | LOG_JSON_HTTP_BODY_BASE64)

Definition at line 98 of file output-json-alert.c.

◆ JSON_STREAM_BUFFER_SIZE

#define JSON_STREAM_BUFFER_SIZE   4096

Definition at line 100 of file output-json-alert.c.

◆ LOG_JSON_APP_LAYER

#define LOG_JSON_APP_LAYER   BIT_U16(4)

Definition at line 87 of file output-json-alert.c.

◆ LOG_JSON_FLOW

#define LOG_JSON_FLOW   BIT_U16(5)

Definition at line 88 of file output-json-alert.c.

◆ LOG_JSON_HTTP_BODY

#define LOG_JSON_HTTP_BODY   BIT_U16(6)

Definition at line 89 of file output-json-alert.c.

◆ LOG_JSON_HTTP_BODY_BASE64

#define LOG_JSON_HTTP_BODY_BASE64   BIT_U16(7)

Definition at line 90 of file output-json-alert.c.

◆ LOG_JSON_PACKET

#define LOG_JSON_PACKET   BIT_U16(1)

Definition at line 84 of file output-json-alert.c.

◆ LOG_JSON_PAYLOAD

#define LOG_JSON_PAYLOAD   BIT_U16(0)

Definition at line 83 of file output-json-alert.c.

◆ LOG_JSON_PAYLOAD_BASE64

#define LOG_JSON_PAYLOAD_BASE64   BIT_U16(2)

Definition at line 85 of file output-json-alert.c.

◆ LOG_JSON_RULE

#define LOG_JSON_RULE   BIT_U16(9)

Definition at line 92 of file output-json-alert.c.

◆ LOG_JSON_RULE_METADATA

#define LOG_JSON_RULE_METADATA   BIT_U16(8)

Definition at line 91 of file output-json-alert.c.

◆ LOG_JSON_TAGGED_PACKETS

#define LOG_JSON_TAGGED_PACKETS   BIT_U16(3)

Definition at line 86 of file output-json-alert.c.

◆ METADATA_DEFAULTS

#define METADATA_DEFAULTS
Value:
LOG_JSON_APP_LAYER | \
LOG_JSON_RULE_METADATA)

Definition at line 94 of file output-json-alert.c.

◆ MODULE_NAME

#define MODULE_NAME   "JsonAlertLog"

Definition at line 81 of file output-json-alert.c.

Typedef Documentation

◆ AlertJsonOutputCtx

◆ JsonAlertLogThread

Function Documentation

◆ AlertJsonHeader()

◆ JsonAlertLogRegister()

void JsonAlertLogRegister ( void  )

Definition at line 995 of file output-json-alert.c.

References LOGGER_JSON_ALERT, MODULE_NAME, and OutputRegisterPacketModule().

Referenced by OutputRegisterLoggers().

Here is the call graph for this function:
Here is the caller graph for this function:
LOG_JSON_FLOW
#define LOG_JSON_FLOW
Definition: output-json-alert.c:88