syslog-ng source
msg-format.c File Reference
#include "msg-format.h"
#include "cfg.h"
#include "plugin.h"
#include "plugin-types.h"
#include "find-crlf.h"
#include "scratch-buffers.h"
#include "utf8utils.h"
#include "hostname.h"
Include dependency graph for msg-format.c:

Functions

gboolean msg_format_try_parse_into (MsgFormatOptions *options, LogMessage *msg, const guchar *data, gsize length, gsize *problem_position)
 
void msg_format_parse_into (MsgFormatOptions *options, LogMessage *msg, const guchar *data, gsize length)
 
gsize msg_format_from_string (MsgFormatOptions *format_options, const char *msg_cstring, LogMessage **out_msg)
 
LogMessage * msg_format_construct_message (MsgFormatOptions *options, const guchar *data, gsize length)
 
LogMessage * msg_format_parse (MsgFormatOptions *options, const guchar *data, gsize length)
 
gboolean msg_format_options_set_sdata_prefix (MsgFormatOptions *options, const gchar *prefix)
 
void msg_format_options_defaults (MsgFormatOptions *options)
 
void msg_format_options_init (MsgFormatOptions *options, GlobalConfig *cfg)
 
void msg_format_options_copy (MsgFormatOptions *options, const MsgFormatOptions *source)
 
void msg_format_options_destroy (MsgFormatOptions *options)
 
gboolean msg_format_options_process_flag (MsgFormatOptions *options, const gchar *flag)
 

Variables

CfgFlagHandler msg_format_flag_handlers []
 

Function Documentation

◆ msg_format_construct_message()

LogMessage* msg_format_construct_message ( MsgFormatOptions options,
const guchar *  data,
gsize  length 
)

◆ msg_format_from_string()

gsize msg_format_from_string ( MsgFormatOptions format_options,
const char *  msg_cstring,
LogMessage **  out_msg 
)

◆ msg_format_options_copy()

void msg_format_options_copy ( MsgFormatOptions options,
const MsgFormatOptions source 
)

◆ msg_format_options_defaults()

void msg_format_options_defaults ( MsgFormatOptions options)

◆ msg_format_options_destroy()

void msg_format_options_destroy ( MsgFormatOptions options)

◆ msg_format_options_init()

void msg_format_options_init ( MsgFormatOptions options,
GlobalConfig *  cfg 
)

◆ msg_format_options_process_flag()

gboolean msg_format_options_process_flag ( MsgFormatOptions options,
const gchar *  flag 
)

◆ msg_format_options_set_sdata_prefix()

gboolean msg_format_options_set_sdata_prefix ( MsgFormatOptions options,
const gchar *  prefix 
)

◆ msg_format_parse()

LogMessage* msg_format_parse ( MsgFormatOptions options,
const guchar *  data,
gsize  length 
)

◆ msg_format_parse_into()

void msg_format_parse_into ( MsgFormatOptions options,
LogMessage *  msg,
const guchar *  data,
gsize  length 
)

◆ msg_format_try_parse_into()

gboolean msg_format_try_parse_into ( MsgFormatOptions options,
LogMessage *  msg,
const guchar *  data,
gsize  length,
gsize *  problem_position 
)

Variable Documentation

◆ msg_format_flag_handlers

CfgFlagHandler msg_format_flag_handlers[]
Initial value:
=
{
{ "no-parse", CFH_SET, offsetof(MsgFormatOptions, flags), LP_NOPARSE },
{ "check-hostname", CFH_SET, offsetof(MsgFormatOptions, flags), LP_CHECK_HOSTNAME },
{ "syslog-protocol", CFH_SET, offsetof(MsgFormatOptions, flags), LP_SYSLOG_PROTOCOL },
{ "assume-utf8", CFH_SET, offsetof(MsgFormatOptions, flags), LP_ASSUME_UTF8 },
{ "validate-utf8", CFH_SET, offsetof(MsgFormatOptions, flags), LP_VALIDATE_UTF8 },
{ "sanitize-utf8", CFH_SET, offsetof(MsgFormatOptions, flags), LP_SANITIZE_UTF8 },
{ "no-multi-line", CFH_SET, offsetof(MsgFormatOptions, flags), LP_NO_MULTI_LINE },
{ "store-legacy-msghdr", CFH_SET, offsetof(MsgFormatOptions, flags), LP_STORE_LEGACY_MSGHDR },
{ "store-raw-message", CFH_SET, offsetof(MsgFormatOptions, flags), LP_STORE_RAW_MESSAGE },
{ "dont-store-legacy-msghdr", CFH_CLEAR, offsetof(MsgFormatOptions, flags), LP_STORE_LEGACY_MSGHDR },
{ "expect-hostname", CFH_SET, offsetof(MsgFormatOptions, flags), LP_EXPECT_HOSTNAME },
{ "no-hostname", CFH_CLEAR, offsetof(MsgFormatOptions, flags), LP_EXPECT_HOSTNAME },
{ "guess-timezone", CFH_SET, offsetof(MsgFormatOptions, flags), LP_GUESS_TIMEZONE },
{ "no-header", CFH_SET, offsetof(MsgFormatOptions, flags), LP_NO_HEADER },
{ "no-rfc3164-fallback", CFH_SET, offsetof(MsgFormatOptions, flags), LP_NO_RFC3164_FALLBACK },
{ "piggyback-errors", CFH_SET, offsetof(MsgFormatOptions, flags), LP_PIGGYBACK_ERRORS },
{ "no-piggyback-errors", CFH_CLEAR, offsetof(MsgFormatOptions, flags), LP_PIGGYBACK_ERRORS },
{ "check-program", CFH_SET, offsetof(MsgFormatOptions, flags), LP_CHECK_PROGRAM },
{ NULL },
}
@ CFH_CLEAR
Definition: cfg-parser.h:56
@ CFH_SET
Definition: cfg-parser.h:55
@ LP_STORE_LEGACY_MSGHDR
Definition: msg-format.h:51
@ LP_SYSLOG_PROTOCOL
Definition: msg-format.h:41
@ LP_VALIDATE_UTF8
Definition: msg-format.h:45
@ LP_NO_MULTI_LINE
Definition: msg-format.h:49
@ LP_SANITIZE_UTF8
Definition: msg-format.h:47
@ LP_NO_RFC3164_FALLBACK
Definition: msg-format.h:61
@ LP_STORE_RAW_MESSAGE
Definition: msg-format.h:58
@ LP_PIGGYBACK_ERRORS
Definition: msg-format.h:62
@ LP_GUESS_TIMEZONE
Definition: msg-format.h:59
@ LP_CHECK_PROGRAM
Definition: msg-format.h:63
@ LP_NO_HEADER
Definition: msg-format.h:60
@ LP_ASSUME_UTF8
Definition: msg-format.h:43
@ LP_EXPECT_HOSTNAME
Definition: msg-format.h:53
@ LP_CHECK_HOSTNAME
Definition: msg-format.h:39
@ LP_NOPARSE
Definition: msg-format.h:37
Definition: msg-format.h:69