@@ -90,8 +90,13 @@ public List<String> evaluate(FunctionArgs functionArgs, EvaluationContext evalua
9090
9191 this .timeRange = RelativeRange .builder ().type ("relative" ).range (timeRange ).build ();
9292
93- this .query = dstField + ":" + evaluationContext .currentMessage ().getField (srcField ).toString ();
94- LOG .debug ("Query: {}" , this .query .toString ());
93+ String srcFieldValue = evaluationContext .currentMessage ().getField (srcField ).toString ();
94+ String escapeChars ="[\\ \\ +\\ -\\ !\\ (\\ )\\ :\\ ^\\ ]\\ {\\ }\\ ~\\ *\\ ?]" ;
95+
96+ if (!dstField .equals ("timestamp" )) {
97+ this .query = dstField + ":" + srcFieldValue .replaceAll (escapeChars , "\\ \\ $0" );
98+ LOG .info ("Query: {}" , this .query .toString ());
99+ }
95100
96101 this .filter = "streams:" + stream ;
97102 LOG .debug ("Filter: {}" , this .filter .toString ());
@@ -120,14 +125,14 @@ public List<String> evaluate(FunctionArgs functionArgs, EvaluationContext evalua
120125 SearchResult response = this .searches .search (searchesConfig );
121126 LOG .debug ("Search config - field: {}, order: {}" , searchesConfig .sorting ().getField ().toString (), searchesConfig .sorting ().asElastic ().toString ());
122127 if (response .getResults ().size () == 0 ) {
123- LOG .debug ("No Search Results observed." );
128+ LOG .info ("No Search Results observed." );
124129 return blankList ;
125130 }
126131 else
127132 {
128133
129134 if (response .getResults ().size () >= 1 ) {
130- LOG .debug ("There are results" );
135+ LOG .info ("There are results" );
131136 List <ResultMessage > resultMessages = response .getResults ();
132137 try {
133138 //Map<String, Object> resultFields = resultMessages.get(0).getMessage().getFields();
0 commit comments