Skip to content

Commit

Permalink
redis: support for all output types
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjulien committed Dec 20, 2016
1 parent 2820ed3 commit 5867742
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/util-error.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ const char * SCErrorToString(SCError err)
CASE_CODE (SC_ERR_DIR_OPEN);
CASE_CODE(SC_WARN_REMOVE_FILE);
CASE_CODE (SC_ERR_NO_MAGIC_SUPPORT);
CASE_CODE (SC_ERR_REDIS);
}

return "UNKNOWN_ERROR";
Expand Down
1 change: 1 addition & 0 deletions src/util-error.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ typedef enum {
SC_ERR_DIR_OPEN,
SC_WARN_REMOVE_FILE,
SC_ERR_NO_MAGIC_SUPPORT,
SC_ERR_REDIS,
} SCError;

const char *SCErrorToString(SCError);
Expand Down
9 changes: 9 additions & 0 deletions src/util-logopenfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,15 @@ SCConfLogOpenGeneric(ConfNode *conf,
log_ctx->pcie_fp = SCLogOpenPcieFp(log_ctx, log_path, append);
if (log_ctx->pcie_fp == NULL)
return -1; // Error already logged by Open...Fp routine
#ifdef HAVE_LIBHIREDIS
} else if (strcasecmp(filetype, "redis") == 0) {
ConfNode *redis_node = ConfNodeLookupChild(conf, "redis");
if (SCConfLogOpenRedis(redis_node, log_ctx) < 0) {
SCLogError(SC_ERR_REDIS, "failed to open redis output");
return -1;
}
log_ctx->type = LOGFILE_TYPE_REDIS;
#endif
} else {
SCLogError(SC_ERR_INVALID_YAML_CONF_ENTRY, "Invalid entry for "
"%s.filetype. Expected \"regular\" (default), \"unix_stream\", "
Expand Down

0 comments on commit 5867742

Please sign in to comment.