From 8a9c86b7bd0e04c6f7c5f734933b75ef374f92fe Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Thu, 23 Jan 2020 13:10:44 +0100 Subject: [PATCH] util-log-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. (cherry picked from commit 21431f166c337a7d3dd8ff8cc3aacbe686414ae3) --- 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 b6ff2b6717..5259b18da4 100644 --- a/src/util-log-redis.c +++ b/src/util-log-redis.c @@ -360,6 +360,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; -- 2.47.2