From ec8eba28a8ec0b7cb6eba5291da0174e8ab018db Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Thu, 23 Jan 2020 13:10:44 +0100 Subject: [PATCH] redis: fix reconnect in batch mode In case of redis outage, the redis session was reset but the replies were still fetch even if there is none replies in the new session. --- src/util-log-redis.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util-log-redis.c b/src/util-log-redis.c index afc4d4858a..4c4d37f2e9 100644 --- a/src/util-log-redis.c +++ b/src/util-log-redis.c @@ -369,6 +369,12 @@ static int SCLogRedisWriteSync(LogFileCtx *file_ctx, const char *string) redis = ctx->sync; if (redis) { SCLogInfo("Reconnected to redis server"); + redisAppendCommand(redis, "%s %s %s", + file_ctx->redis_setup.command, + file_ctx->redis_setup.key, + string); + ctx->batch_count++; + return 0; } else { SCLogInfo("Unable to reconnect to redis server"); return -1;