diff --git a/src/util-log-redis.c b/src/util-log-redis.c index b6ff2b6717..afc4d4858a 100644 --- a/src/util-log-redis.c +++ b/src/util-log-redis.c @@ -201,7 +201,11 @@ static int SCConfLogReopenAsyncRedis(LogFileCtx *log_ctx) return -1; } - ctx->async = redisAsyncConnect(redis_server, redis_port); + if (strchr(redis_server, '/') == NULL) { + ctx->async = redisAsyncConnect(redis_server, redis_port); + } else { + ctx->async = redisAsyncConnectUnix(redis_server); + } if (ctx->ev_base != NULL) { event_base_free(ctx->ev_base); @@ -295,7 +299,12 @@ static int SCConfLogReopenSyncRedis(LogFileCtx *log_ctx) if (ctx->sync != NULL) { redisFree(ctx->sync); } - ctx->sync = redisConnect(redis_server, redis_port); + + if (strchr(redis_server, '/') == NULL) { + ctx->sync = redisConnect(redis_server, redis_port); + } else { + ctx->sync = redisConnectUnix(redis_server); + } if (ctx->sync == NULL) { SCLogError(SC_ERR_SOCKET, "Error connecting to redis server."); ctx->tried = time(NULL);