syslog-ng source
patternize.c File Reference
#include "patternize.h"
#include "logmsg/logmsg.h"
#include "messages.h"
#include "uuid.h"
#include "msg-format.h"
#include <stdlib.h>
#include <string.h>
Include dependency graph for patternize.c:

Macros

#define PTZ_MAXLINELEN   10240
 
#define PTZ_MAXWORDS   512 /* maximum number of words in one line */
 
#define PTZ_LOGTABLE_ALLOC_BASE   3000
 
#define PTZ_WORDLIST_CACHE   3 /* FIXME: make this a commandline parameter? */
 

Functions

guint ptz_str2hash (gchar *string, guint modulo, guint seed)
 
gchar * ptz_find_delimiters (gchar *str, const gchar *delimdef)
 
gboolean ptz_find_frequent_words_remove_key_predicate (gpointer key, gpointer value, gpointer support)
 
GHashTable * ptz_find_frequent_words (GPtrArray *logs, guint support, const gchar *delimiters, gboolean two_pass)
 
gboolean ptz_find_clusters_remove_cluster_predicate (gpointer key, gpointer value, gpointer data)
 
GHashTable * ptz_find_clusters_slct (GPtrArray *logs, guint support, const gchar *delimiters, guint num_of_samples)
 
GHashTable * ptz_find_clusters_step (Patternizer *self, GPtrArray *logs, guint support, guint num_of_samples)
 
GHashTable * ptz_find_clusters (Patternizer *self)
 
void ptz_print_patterndb_rule (gpointer key, gpointer value, gpointer user_data)
 
void ptz_print_patterndb (GHashTable *clusters, const gchar *delimiters, gboolean named_parsers)
 
gboolean ptz_load_file (Patternizer *self, gchar *input_file, gboolean no_parse, GError **error)
 
Patternizerptz_new (gdouble support_treshold, guint algo, guint iterate, guint num_of_samples, const gchar *delimiters)
 
void ptz_free (Patternizer *self)
 

Macro Definition Documentation

◆ PTZ_LOGTABLE_ALLOC_BASE

#define PTZ_LOGTABLE_ALLOC_BASE   3000

◆ PTZ_MAXLINELEN

#define PTZ_MAXLINELEN   10240

◆ PTZ_MAXWORDS

#define PTZ_MAXWORDS   512 /* maximum number of words in one line */

◆ PTZ_WORDLIST_CACHE

#define PTZ_WORDLIST_CACHE   3 /* FIXME: make this a commandline parameter? */

Function Documentation

◆ ptz_find_clusters()

GHashTable* ptz_find_clusters ( Patternizer self)

◆ ptz_find_clusters_remove_cluster_predicate()

gboolean ptz_find_clusters_remove_cluster_predicate ( gpointer  key,
gpointer  value,
gpointer  data 
)

◆ ptz_find_clusters_slct()

GHashTable* ptz_find_clusters_slct ( GPtrArray *  logs,
guint  support,
const gchar *  delimiters,
guint  num_of_samples 
)

◆ ptz_find_clusters_step()

GHashTable* ptz_find_clusters_step ( Patternizer self,
GPtrArray *  logs,
guint  support,
guint  num_of_samples 
)

◆ ptz_find_delimiters()

gchar* ptz_find_delimiters ( gchar *  str,
const gchar *  delimdef 
)

◆ ptz_find_frequent_words()

GHashTable* ptz_find_frequent_words ( GPtrArray *  logs,
guint  support,
const gchar *  delimiters,
gboolean  two_pass 
)

◆ ptz_find_frequent_words_remove_key_predicate()

gboolean ptz_find_frequent_words_remove_key_predicate ( gpointer  key,
gpointer  value,
gpointer  support 
)

◆ ptz_free()

void ptz_free ( Patternizer self)

◆ ptz_load_file()

gboolean ptz_load_file ( Patternizer self,
gchar *  input_file,
gboolean  no_parse,
GError **  error 
)

◆ ptz_new()

Patternizer* ptz_new ( gdouble  support_treshold,
guint  algo,
guint  iterate,
guint  num_of_samples,
const gchar *  delimiters 
)

◆ ptz_print_patterndb()

void ptz_print_patterndb ( GHashTable *  clusters,
const gchar *  delimiters,
gboolean  named_parsers 
)

◆ ptz_print_patterndb_rule()

void ptz_print_patterndb_rule ( gpointer  key,
gpointer  value,
gpointer  user_data 
)

◆ ptz_str2hash()

guint ptz_str2hash ( gchar *  string,
guint  modulo,
guint  seed 
)