From 0f5131208195268646fc2c2f59ce0cd817691504 Mon Sep 17 00:00:00 2001 From: Eric Fontana Date: Thu, 11 Sep 2014 07:55:34 -0400 Subject: [PATCH] Fixed problem with Drop and Conditionals. --- TimberWinR/Filters/GrokFilter.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/TimberWinR/Filters/GrokFilter.cs b/TimberWinR/Filters/GrokFilter.cs index 8d61da2..dbfe3c5 100644 --- a/TimberWinR/Filters/GrokFilter.cs +++ b/TimberWinR/Filters/GrokFilter.cs @@ -40,12 +40,21 @@ namespace TimberWinR.Parser if (json_type != null && json_type.ToString() != Type) return true; // Filter does not apply. } - - if (Condition != null && !EvaluateCondition(json, Condition)) - return false; - + if (Matches(json)) { + if (Condition != null) + { + var expr = EvaluateCondition(json, Condition); + if (expr) + { + if (DropIfMatch) + return false; // drop this one + } + else + return false; + } + if (DropIfMatch) return false;