Projects STRLCPY LoggerPlusPlus Commits 4e1e8954
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■
    build.gradle
    skipped 13 lines
    14 14   compile 'org.swinglabs:swingx:1.6.1'
    15 15   compile 'com.github.CoreyD97:BurpExtenderUtilities:3e5df57fb8dec5d64f61206dda5f4e1e9d643558'
    16 16   compile 'com.google.code.gson:gson:2.8.2'
    17  - compile 'org.elasticsearch.client:elasticsearch-rest-high-level-client:7.3.0'
     17 + compile 'org.elasticsearch.client:elasticsearch-rest-high-level-client:7.5.2'
    18 18   compile 'org.apache.httpcomponents:httpclient:4.5.6'
    19 19   compile 'org.apache.commons:commons-text:1.7'
    20 20   // Test on unix system
    skipped 19 lines
  • ■ ■ ■ ■ ■
    src/main/java/com/nccgroup/loggerplusplus/filter/parser/Filter.jj
    skipped 5 lines
    6 6  
    7 7  
    8 8  
    9  - DEBUG_PARSER = true;
     9 +// DEBUG_PARSER = true;
    10 10  }
    11 11   
    12 12  PARSER_BEGIN(FilterParser)
    skipped 382 lines
    395 395   field = LogEntryField.getByLabel(fieldGroup, identifier.image);
    396 396   if(field == null){
    397 397   StringBuilder fieldMessage = new StringBuilder();
    398  - ArrayList<LogEntryField> fields = new ArrayList<LogEntryField>(getFieldsInGroup(FieldGroup.REQUEST));
     398 + ArrayList<LogEntryField> fields = new ArrayList<LogEntryField>(getFieldsInGroup(fieldGroup));
    399 399   for (int i = 0; i < fields.size(); i++) {
     400 + if(fields.get(i) == LogEntryField.NUMBER) continue;
    400 401   fieldMessage.append(fields.get(i).getDescriptiveMessage());
    401 402   if(i != fields.size()-1)
    402 403   fieldMessage.append("\n\n");
    skipped 155 lines
  • ■ ■ ■ ■ ■
    src/main/java/com/nccgroup/loggerplusplus/filter/parser/Filter.jjt
    skipped 4 lines
    5 5  // VISITOR_RETURN_TYPE="VisitorData";
    6 6   VISITOR_DATA_TYPE="VisitorData";
    7 7   NODE_DEFAULT_VOID=true;
    8  - DEBUG_PARSER = true;
     8 +// DEBUG_PARSER = true;
    9 9  }
    10 10   
    11 11  PARSER_BEGIN(FilterParser)
    skipped 300 lines
    312 312   field = LogEntryField.getByLabel(fieldGroup, identifier.image);
    313 313   if(field == null){
    314 314   StringBuilder fieldMessage = new StringBuilder();
    315  - ArrayList<LogEntryField> fields = new ArrayList<LogEntryField>(getFieldsInGroup(FieldGroup.REQUEST));
     315 + ArrayList<LogEntryField> fields = new ArrayList<LogEntryField>(getFieldsInGroup(fieldGroup));
    316 316   for (int i = 0; i < fields.size(); i++) {
     317 + if(fields.get(i) == LogEntryField.NUMBER) continue;
    317 318   fieldMessage.append(fields.get(i).getDescriptiveMessage());
    318 319   if(i != fields.size()-1)
    319 320   fieldMessage.append("\n\n");
    skipped 155 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/com/nccgroup/loggerplusplus/filter/parser/FilterParser.java
    skipped 37 lines
    38 38   throw new ParseException(String.format("Cannot mix operators %s, %s. Please use parenthesis to remove ambiguity.", op.getLabel(), other.getLabel()));
    39 39   }
    40 40   
    41  - final public ASTExpression Filter() throws ParseException { try {
    42  -ASTExpression ex;
    43  - ex = Expression(false);
    44  - jj_consume_token(0);
     41 + final public ASTExpression Filter() throws ParseException {ASTExpression ex;
     42 + ex = Expression(false);
     43 + jj_consume_token(0);
    45 44  {if ("" != null) return ex;}
    46 45   throw new Error("Missing return statement in function");
    47  - } finally {
    48  - trace_return("Filter");
    49  - }
    50 46  }
    51 47   
    52  - final public ASTExpression Expression(boolean inverse) throws ParseException { try {
    53  -/*@bgen(jjtree) Expression */
     48 + final public ASTExpression Expression(boolean inverse) throws ParseException {/*@bgen(jjtree) Expression */
    54 49   ASTExpression jjtn000 = new ASTExpression(JJTEXPRESSION);
    55 50   boolean jjtc000 = true;
    56 51   jjtree.openNodeScope(jjtn000);BooleanOperator op = null;
    57  - try {
    58  - ExpressionInner();
    59  - if (jj_2_1(2)) {
    60  - op = ExpressionCompounding();
    61  - } else {
    62  - ;
    63  - }
     52 + try {
     53 + ExpressionInner();
     54 + if (jj_2_1(2)) {
     55 + op = ExpressionCompounding();
     56 + } else {
     57 + ;
     58 + }
    64 59  jjtree.closeNodeScope(jjtn000, true);
    65 60   jjtc000 = false;
    66 61  jjtn000.op = op;
    67 62   jjtn000.inverse = inverse;
    68 63   {if ("" != null) return jjtn000;}
    69  - } catch (Throwable jjte000) {
     64 + } catch (Throwable jjte000) {
    70 65  if (jjtc000) {
    71 66   jjtree.clearNodeScope(jjtn000);
    72 67   jjtc000 = false;
    skipped 7 lines
    80 75   {if (true) throw (ParseException)jjte000;}
    81 76   }
    82 77   {if (true) throw (Error)jjte000;}
    83  - } finally {
     78 + } finally {
    84 79  if (jjtc000) {
    85 80   jjtree.closeNodeScope(jjtn000, true);
    86 81   }
    87  - }
    88  - throw new Error("Missing return statement in function");
    89  - } finally {
    90  - trace_return("Expression");
    91 82   }
     83 + throw new Error("Missing return statement in function");
    92 84  }
    93 85   
    94  - final public void WrappedCompoundExpression() throws ParseException { try {
    95  -boolean inverse=false;
    96  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    97  - case INVERSE:{
    98  - inverse = Inverse();
    99  - break;
    100  - }
    101  - default:
    102  - jj_la1[0] = jj_gen;
    103  - ;
     86 + final public void WrappedCompoundExpression() throws ParseException {boolean inverse=false;
     87 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     88 + case INVERSE:{
     89 + inverse = Inverse();
     90 + break;
     91 + }
     92 + default:
     93 + jj_la1[0] = jj_gen;
     94 + ;
     95 + }
     96 + jj_consume_token(LPAREN);
     97 + Expression(inverse);
     98 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     99 + case RPAREN:{
     100 + jj_consume_token(RPAREN);
     101 + break;
    104 102   }
    105  - jj_consume_token(LPAREN);
    106  - Expression(inverse);
    107  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    108  - case RPAREN:{
    109  - jj_consume_token(RPAREN);
    110  - break;
    111  - }
    112  - default:
    113  - jj_la1[1] = jj_gen;
     103 + default:
     104 + jj_la1[1] = jj_gen;
    114 105  {if (true) throw new ParseException("Unbalanced brackets.");}
    115  - }
    116  - } finally {
    117  - trace_return("WrappedCompoundExpression");
    118 106   }
    119 107  }
    120 108   
    121  - final public void ExpressionInner() throws ParseException { try {
    122  - 
    123  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    124  - case LPAREN:
    125  - case INVERSE:{
    126  - WrappedCompoundExpression();
    127  - break;
    128  - }
    129  - default:
    130  - jj_la1[2] = jj_gen;
    131  - Statement();
     109 + final public void ExpressionInner() throws ParseException {
     110 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     111 + case LPAREN:
     112 + case INVERSE:{
     113 + WrappedCompoundExpression();
     114 + break;
    132 115   }
    133  - } finally {
    134  - trace_return("ExpressionInner");
     116 + default:
     117 + jj_la1[2] = jj_gen;
     118 + Statement();
    135 119   }
    136 120  }
    137 121   
    138  - final public void Statement() throws ParseException { try {
    139  - 
    140  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    141  - case ALIAS_SYMBOL:{
    142  - Alias();
    143  - break;
    144  - }
    145  - default:
    146  - jj_la1[3] = jj_gen;
    147  - Comparison();
     122 + final public void Statement() throws ParseException {
     123 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     124 + case ALIAS_SYMBOL:{
     125 + Alias();
     126 + break;
    148 127   }
    149  - } finally {
    150  - trace_return("Statement");
     128 + default:
     129 + jj_la1[3] = jj_gen;
     130 + Comparison();
    151 131   }
    152 132  }
    153 133   
    154  - final public BooleanOperator ExpressionCompounding() throws ParseException { try {
    155  -BooleanOperator op;
     134 + final public BooleanOperator ExpressionCompounding() throws ParseException {BooleanOperator op;
    156 135   BooleanOperator nextOp;
     136 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     137 + case AND:{
     138 + op = And();
     139 + break;
     140 + }
     141 + case OR:{
     142 + op = Or();
     143 + break;
     144 + }
     145 + case XOR:{
     146 + op = Xor();
     147 + break;
     148 + }
     149 + default:
     150 + jj_la1[4] = jj_gen;
     151 + jj_consume_token(-1);
     152 + throw new ParseException();
     153 + }
     154 + ExpressionInner();
     155 + label_1:
     156 + while (true) {
     157 + if (jj_2_2(2)) {
     158 + ;
     159 + } else {
     160 + break label_1;
     161 + }
    157 162   switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    158 163   case AND:{
    159  - op = And();
     164 + nextOp = And();
    160 165   break;
    161 166   }
    162 167   case OR:{
    163  - op = Or();
     168 + nextOp = Or();
    164 169   break;
    165 170   }
    166 171   case XOR:{
    167  - op = Xor();
     172 + nextOp = Xor();
    168 173   break;
    169 174   }
    170 175   default:
    171  - jj_la1[4] = jj_gen;
     176 + jj_la1[5] = jj_gen;
    172 177   jj_consume_token(-1);
    173 178   throw new ParseException();
    174 179   }
    175  - ExpressionInner();
    176  - label_1:
    177  - while (true) {
    178  - if (jj_2_2(2)) {
    179  - ;
    180  - } else {
    181  - break label_1;
    182  - }
    183  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    184  - case AND:{
    185  - nextOp = And();
    186  - break;
    187  - }
    188  - case OR:{
    189  - nextOp = Or();
    190  - break;
    191  - }
    192  - case XOR:{
    193  - nextOp = Xor();
    194  - break;
    195  - }
    196  - default:
    197  - jj_la1[5] = jj_gen;
    198  - jj_consume_token(-1);
    199  - throw new ParseException();
    200  - }
    201 180  //Subsequent compoundings must be same operator. Otherwise, throw exception.
    202 181   if(op != nextOp) throwOperatorAmbiguityException(op,nextOp);
    203  - ExpressionInner();
    204  - }
     182 + ExpressionInner();
     183 + }
    205 184  {if ("" != null) return op;}
    206 185   throw new Error("Missing return statement in function");
    207  - } finally {
    208  - trace_return("ExpressionCompounding");
    209  - }
    210 186  }
    211 187   
    212 188  //Comparisons can take two forms (Value) or (value operation value).
    213 189  //To make interpretation easier, we convert (Value) to (Value operation value) by means of (Value EQUALS TRUE)
    214  - final public void Comparison() throws ParseException { try {
    215  -/*@bgen(jjtree) Comparison */
     190 + final public void Comparison() throws ParseException {/*@bgen(jjtree) Comparison */
    216 191   ASTComparison jjtn000 = new ASTComparison(JJTCOMPARISON);
    217 192   boolean jjtc000 = true;
    218 193   jjtree.openNodeScope(jjtn000);Operator op = Operator.EQUAL;
    219 194   Object left, right = true;
    220  - try {
     195 + try {
     196 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     197 + case IDENTIFIER:{
     198 + left = Identifier();
     199 + break;
     200 + }
     201 + default:
     202 + jj_la1[6] = jj_gen;
     203 +{if (true) throw new ParseException("The left side of a comparison must be a field identifier.");}
     204 + }
     205 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     206 + case EQ:
     207 + case NEQ:{
     208 + op = EqualityOperator();
    221 209   switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    222  - case IDENTIFIER:{
    223  - left = Identifier();
     210 + case BOOLEAN:
     211 + case NUMBER:
     212 + case REGEXLITERAL_IN_FORWARD_SLASHES:
     213 + case REGEX_IN_FORWARD_SLASHES:
     214 + case INVERSE:
     215 + case IDENTIFIER:
     216 + case OPEN_SINGLE_QUOTE_STRING:
     217 + case OPEN_DOUBLE_QUOTE_STRING:{
     218 + right = Value();
    224 219   break;
    225 220   }
    226 221   default:
    227  - jj_la1[6] = jj_gen;
    228  -{if (true) throw new ParseException("The left side of a comparison must be a field identifier.");}
    229  - }
    230  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    231  - case EQ:
    232  - case NEQ:{
    233  - op = EqualityOperator();
    234  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    235  - case BOOLEAN:
    236  - case NUMBER:
    237  - case REGEXLITERAL_IN_FORWARD_SLASHES:
    238  - case REGEX_IN_FORWARD_SLASHES:
    239  - case INVERSE:
    240  - case IDENTIFIER:
    241  - case OPEN_SINGLE_QUOTE_STRING:
    242  - case OPEN_DOUBLE_QUOTE_STRING:{
    243  - right = Value();
    244  - break;
    245  - }
    246  - default:
    247  - jj_la1[7] = jj_gen;
     222 + jj_la1[7] = jj_gen;
    248 223  {if (true) throw new ParseException("Invalid right hand value for comparison \"" + op + "\"");}
    249  - }
     224 + }
    250 225  if(right instanceof Pattern && !String.class.isAssignableFrom(((LogEntryField) left).getType())){
    251 226   {if (true) throw new ParseException(String.format("Regex patterns can only be used on fields which can be converted to a string. Field \"%s\" of type \"%s\" cannot be converted.", left, ((LogEntryField) left).getType()));}
    252 227   }
    253  - break;
    254  - }
    255  - case GT:
    256  - case LT:
    257  - case GEQ:
    258  - case LEQ:{
    259  - op = NumericOperator();
     228 + break;
     229 + }
     230 + case GT:
     231 + case LT:
     232 + case GEQ:
     233 + case LEQ:{
     234 + op = NumericOperator();
    260 235  if(!Number.class.isAssignableFrom(((LogEntryField) left).getType())){
    261 236   {if (true) throw new ParseException(String.format("Numeric operators cannot be used for field \"%s\" of type \"%s\"", left, ((LogEntryField) left).getType()));}
    262 237   }
    263  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    264  - case NUMBER:{
    265  - right = Number();
    266  - break;
    267  - }
    268  - case IDENTIFIER:{
    269  - right = Identifier();
     238 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     239 + case NUMBER:{
     240 + right = Number();
     241 + break;
     242 + }
     243 + case IDENTIFIER:{
     244 + right = Identifier();
    270 245  if(!Number.class.isAssignableFrom(((LogEntryField) right).getType())){
    271 246   {if (true) throw new ParseException(String.format("Numeric operators cannot be used for field \"%s\" of type \"%s\"", right, ((LogEntryField) right).getType()));}
    272 247   }
    273  - break;
    274  - }
    275  - default:
    276  - jj_la1[8] = jj_gen;
     248 + break;
     249 + }
     250 + default:
     251 + jj_la1[8] = jj_gen;
    277 252  {if (true) throw new ParseException("Invalid right hand value for comparison \"" + op + "\"");}
     253 + }
     254 + break;
     255 + }
     256 + case CONTAINS:{
     257 + op = ContainsOperator();
     258 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     259 + case OPEN_SINGLE_QUOTE_STRING:
     260 + case OPEN_DOUBLE_QUOTE_STRING:{
     261 + right = String();
     262 + break;
    278 263   }
     264 + case NUMBER:{
     265 + right = Number();
     266 + break;
     267 + }
     268 + case IDENTIFIER:{
     269 + right = Identifier();
    279 270   break;
    280 271   }
    281  - case CONTAINS:{
    282  - op = ContainsOperator();
    283  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    284  - case OPEN_SINGLE_QUOTE_STRING:
    285  - case OPEN_DOUBLE_QUOTE_STRING:{
    286  - right = String();
    287  - break;
    288  - }
    289  - case NUMBER:{
    290  - right = Number();
    291  - break;
    292  - }
    293  - case IDENTIFIER:{
    294  - right = Identifier();
    295  - break;
    296  - }
    297  - default:
    298  - jj_la1[9] = jj_gen;
     272 + default:
     273 + jj_la1[9] = jj_gen;
    299 274  {if (true) throw new ParseException("The contains operator can only be used on string and numeric values and identifiers.");}
    300  - }
     275 + }
     276 + break;
     277 + }
     278 + case IN:{
     279 + op = InOperator();
     280 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     281 + case ARRAY_START:{
     282 + right = Array();
    301 283   break;
    302 284   }
    303  - case IN:{
    304  - op = InOperator();
    305  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    306  - case ARRAY_START:{
    307  - right = Array();
    308  - break;
    309  - }
    310  - default:
    311  - jj_la1[10] = jj_gen;
     285 + default:
     286 + jj_la1[10] = jj_gen;
    312 287  {if (true) throw new ParseException("The in operator must be used on an array. E.g. \"Response.status IN [200, 302, 500]\"");}
    313  - }
     288 + }
     289 + break;
     290 + }
     291 + case MATCHES:{
     292 + op = MatchesOperator();
     293 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     294 + case OPEN_SINGLE_QUOTE_STRING:
     295 + case OPEN_DOUBLE_QUOTE_STRING:{
     296 + right = RegexInString();
    314 297   break;
    315 298   }
    316  - case MATCHES:{
    317  - op = MatchesOperator();
    318  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    319  - case OPEN_SINGLE_QUOTE_STRING:
    320  - case OPEN_DOUBLE_QUOTE_STRING:{
    321  - right = RegexInString();
    322  - break;
    323  - }
    324  - case REGEXLITERAL_IN_FORWARD_SLASHES:
    325  - case REGEX_IN_FORWARD_SLASHES:{
    326  - right = RegexInForwardSlashes();
    327  - break;
    328  - }
    329  - default:
    330  - jj_la1[11] = jj_gen;
    331  -{if (true) throw new ParseException("The matches operator must have a pattern as its right hand value.");}
    332  - }
     299 + case REGEXLITERAL_IN_FORWARD_SLASHES:
     300 + case REGEX_IN_FORWARD_SLASHES:{
     301 + right = RegexInForwardSlashes();
    333 302   break;
    334 303   }
    335 304   default:
    336  - jj_la1[12] = jj_gen;
     305 + jj_la1[11] = jj_gen;
     306 +{if (true) throw new ParseException("The matches operator must have a pattern as its right hand value.");}
     307 + }
     308 + break;
     309 + }
     310 + default:
     311 + jj_la1[12] = jj_gen;
    337 312  if(!(left instanceof Boolean || (left instanceof LogEntryField && ((LogEntryField) left).getType().isAssignableFrom(Boolean.class)))){
    338 313   //If left isn't a boolean value or field with boolean type
    339 314   {if (true) throw new ParseException(left + " cannot be evaluated as a boolean.");}
    340 315   }
    341  - }
     316 + }
    342 317  jjtree.closeNodeScope(jjtn000, true);
    343 318   jjtc000 = false;
    344 319  jjtn000.left = left;
    345 320   jjtn000.right = right;
    346 321   jjtn000.operator = op;
    347  - } catch (Throwable jjte000) {
     322 + } catch (Throwable jjte000) {
    348 323  if (jjtc000) {
    349 324   jjtree.clearNodeScope(jjtn000);
    350 325   jjtc000 = false;
    skipped 7 lines
    358 333   {if (true) throw (ParseException)jjte000;}
    359 334   }
    360 335   {if (true) throw (Error)jjte000;}
    361  - } finally {
     336 + } finally {
    362 337  if (jjtc000) {
    363 338   jjtree.closeNodeScope(jjtn000, true);
    364 339   }
    365  - }
    366  - } finally {
    367  - trace_return("Comparison");
    368 340   }
    369 341  }
    370 342   
    371  - final public void Alias() throws ParseException { try {
    372  -/*@bgen(jjtree) Alias */
     343 + final public void Alias() throws ParseException {/*@bgen(jjtree) Alias */
    373 344   ASTAlias jjtn000 = new ASTAlias(JJTALIAS);
    374 345   boolean jjtc000 = true;
    375 346   jjtree.openNodeScope(jjtn000);Token identifier;
    376  - try {
    377  - jj_consume_token(ALIAS_SYMBOL);
    378  - identifier = jj_consume_token(IDENTIFIER);
     347 + try {
     348 + jj_consume_token(ALIAS_SYMBOL);
     349 + identifier = jj_consume_token(IDENTIFIER);
    379 350  jjtree.closeNodeScope(jjtn000, true);
    380 351   jjtc000 = false;
    381 352  jjtn000.identifier = identifier.image;
    382  - } finally {
     353 + } finally {
    383 354  if (jjtc000) {
    384 355   jjtree.closeNodeScope(jjtn000, true);
    385 356   }
    386  - }
    387  - } finally {
    388  - trace_return("Alias");
    389 357   }
    390 358  }
    391 359   
    392  - final public Object Value() throws ParseException { try {
    393  -Object v;
    394  - if (jj_2_3(2)) {
    395  - v = Identifier();
    396  - } else {
    397  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    398  - case NUMBER:{
    399  - v = Number();
    400  - break;
    401  - }
    402  - case BOOLEAN:
    403  - case INVERSE:{
    404  - v = Boolean();
    405  - break;
    406  - }
    407  - case OPEN_SINGLE_QUOTE_STRING:
    408  - case OPEN_DOUBLE_QUOTE_STRING:{
    409  - v = String();
    410  - break;
    411  - }
    412  - case REGEXLITERAL_IN_FORWARD_SLASHES:
    413  - case REGEX_IN_FORWARD_SLASHES:{
    414  - v = RegexInForwardSlashes();
    415  - break;
    416  - }
    417  - default:
    418  - jj_la1[13] = jj_gen;
    419  - jj_consume_token(-1);
    420  - throw new ParseException();
     360 + final public Object Value() throws ParseException {Object v;
     361 + if (jj_2_3(2)) {
     362 + v = Identifier();
     363 + } else {
     364 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     365 + case NUMBER:{
     366 + v = Number();
     367 + break;
     368 + }
     369 + case BOOLEAN:
     370 + case INVERSE:{
     371 + v = Boolean();
     372 + break;
     373 + }
     374 + case OPEN_SINGLE_QUOTE_STRING:
     375 + case OPEN_DOUBLE_QUOTE_STRING:{
     376 + v = String();
     377 + break;
     378 + }
     379 + case REGEXLITERAL_IN_FORWARD_SLASHES:
     380 + case REGEX_IN_FORWARD_SLASHES:{
     381 + v = RegexInForwardSlashes();
     382 + break;
    421 383   }
     384 + default:
     385 + jj_la1[13] = jj_gen;
     386 + jj_consume_token(-1);
     387 + throw new ParseException();
    422 388   }
     389 + }
    423 390  {if ("" != null) return v;}
    424 391   throw new Error("Missing return statement in function");
    425  - } finally {
    426  - trace_return("Value");
    427  - }
    428 392  }
    429 393   
    430  - final public Set Array() throws ParseException { try {
    431  -Set<Object> items = new LinkedHashSet();
     394 + final public Set Array() throws ParseException {Set<Object> items = new LinkedHashSet();
    432 395   Object initial, subsequent;
    433  - jj_consume_token(ARRAY_START);
     396 + jj_consume_token(ARRAY_START);
     397 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     398 + case OPEN_SINGLE_QUOTE_STRING:
     399 + case OPEN_DOUBLE_QUOTE_STRING:{
     400 + initial = String();
     401 + break;
     402 + }
     403 + case NUMBER:{
     404 + initial = Number();
     405 + break;
     406 + }
     407 + default:
     408 + jj_la1[14] = jj_gen;
     409 + jj_consume_token(-1);
     410 + throw new ParseException();
     411 + }
     412 +items.add(initial);
     413 + label_2:
     414 + while (true) {
     415 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     416 + case ARRAY_SEPARATOR:{
     417 + ;
     418 + break;
     419 + }
     420 + default:
     421 + jj_la1[15] = jj_gen;
     422 + break label_2;
     423 + }
     424 + jj_consume_token(ARRAY_SEPARATOR);
    434 425   switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    435 426   case OPEN_SINGLE_QUOTE_STRING:
    436 427   case OPEN_DOUBLE_QUOTE_STRING:{
    437  - initial = String();
     428 + subsequent = String();
    438 429   break;
    439 430   }
    440 431   case NUMBER:{
    441  - initial = Number();
     432 + subsequent = Number();
    442 433   break;
    443 434   }
    444 435   default:
    445  - jj_la1[14] = jj_gen;
     436 + jj_la1[16] = jj_gen;
    446 437   jj_consume_token(-1);
    447 438   throw new ParseException();
    448 439   }
    449  -items.add(initial);
    450  - label_2:
    451  - while (true) {
    452  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    453  - case ARRAY_SEPARATOR:{
    454  - ;
    455  - break;
    456  - }
    457  - default:
    458  - jj_la1[15] = jj_gen;
    459  - break label_2;
    460  - }
    461  - jj_consume_token(ARRAY_SEPARATOR);
    462  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    463  - case OPEN_SINGLE_QUOTE_STRING:
    464  - case OPEN_DOUBLE_QUOTE_STRING:{
    465  - subsequent = String();
    466  - break;
    467  - }
    468  - case NUMBER:{
    469  - subsequent = Number();
    470  - break;
    471  - }
    472  - default:
    473  - jj_la1[16] = jj_gen;
    474  - jj_consume_token(-1);
    475  - throw new ParseException();
    476  - }
    477 440  if(!initial.getClass().isAssignableFrom(subsequent.getClass())){
    478 441   {if (true) throw new ParseException("Array elements must all be of the same type.");}
    479 442   }
    480 443   items.add(subsequent);
    481  - }
    482  - jj_consume_token(ARRAY_END);
     444 + }
     445 + jj_consume_token(ARRAY_END);
    483 446  {if ("" != null) return items;}
    484 447   throw new Error("Missing return statement in function");
    485  - } finally {
    486  - trace_return("Array");
    487  - }
    488 448  }
    489 449   
    490 450  //IDENTIFIERS
    491  - final public LogEntryField Identifier() throws ParseException { try {
    492  -Token group, identifier;
     451 + final public LogEntryField Identifier() throws ParseException {Token group, identifier;
    493 452   FieldGroup fieldGroup;
    494 453   LogEntryField field;
    495  - group = jj_consume_token(IDENTIFIER);
     454 + group = jj_consume_token(IDENTIFIER);
    496 455  fieldGroup = FieldGroup.findByLabel(group.image);
    497 456   if(fieldGroup == null)
    498 457   {if (true) throw new ParseException(String.format("Invalid field group \"%s\". Valid groups are:\n%s", group.image, Arrays.toString(FieldGroup.values())));}
    499  - jj_consume_token(DOT);
    500  - identifier = jj_consume_token(IDENTIFIER);
     458 + jj_consume_token(DOT);
     459 + identifier = jj_consume_token(IDENTIFIER);
    501 460  field = LogEntryField.getByLabel(fieldGroup, identifier.image);
    502 461   if(field == null){
    503 462   StringBuilder fieldMessage = new StringBuilder();
    504  - ArrayList<LogEntryField> fields = new ArrayList<LogEntryField>(getFieldsInGroup(FieldGroup.REQUEST));
     463 + ArrayList<LogEntryField> fields = new ArrayList<LogEntryField>(getFieldsInGroup(fieldGroup));
    505 464   for (int i = 0; i < fields.size(); i++) {
     465 + if(fields.get(i) == LogEntryField.NUMBER) continue;
    506 466   fieldMessage.append(fields.get(i).getDescriptiveMessage());
    507 467   if(i != fields.size()-1)
    508 468   fieldMessage.append("\n\n");
    skipped 4 lines
    513 473   {if (true) throw new ParseException("Field " + LogEntryField.NUMBER + " is ephemeral and cannot be used in filters.");}
    514 474   {if ("" != null) return field;}
    515 475   throw new Error("Missing return statement in function");
    516  - } finally {
    517  - trace_return("Identifier");
    518  - }
    519 476  }
    520 477   
    521 478  //END IDENTIFIERS
    skipped 1 lines
    523 480   
    524 481  //TYPES
    525 482   final public
    526  -BigDecimal Number() throws ParseException { try {
    527  -Token t;
    528  - t = jj_consume_token(NUMBER);
     483 +BigDecimal Number() throws ParseException {Token t;
     484 + t = jj_consume_token(NUMBER);
    529 485  {if ("" != null) return new BigDecimal(t.image);}
    530 486   throw new Error("Missing return statement in function");
    531  - } finally {
    532  - trace_return("Number");
    533  - }
    534 487  }
    535 488   
    536  - final public String String() throws ParseException { try {
    537  -Token t = null;
     489 + final public String String() throws ParseException {Token t = null;
     490 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     491 + case OPEN_SINGLE_QUOTE_STRING:{
     492 + jj_consume_token(OPEN_SINGLE_QUOTE_STRING);
    538 493   switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    539  - case OPEN_SINGLE_QUOTE_STRING:{
    540  - jj_consume_token(OPEN_SINGLE_QUOTE_STRING);
    541  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    542  - case SINGLE_STRING_BODY:{
    543  - t = jj_consume_token(SINGLE_STRING_BODY);
    544  - break;
    545  - }
    546  - default:
    547  - jj_la1[17] = jj_gen;
    548  - ;
     494 + case SINGLE_STRING_BODY:{
     495 + t = jj_consume_token(SINGLE_STRING_BODY);
     496 + break;
    549 497   }
    550  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    551  - case CLOSE_SINGLE_QUOTE_STRING:{
    552  - jj_consume_token(CLOSE_SINGLE_QUOTE_STRING);
    553  - break;
    554  - }
    555  - default:
    556  - jj_la1[18] = jj_gen;
    557  -{if (true) throw new ParseException("Missing closing quote for string.");}
    558  - }
     498 + default:
     499 + jj_la1[17] = jj_gen;
     500 + ;
     501 + }
     502 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     503 + case CLOSE_SINGLE_QUOTE_STRING:{
     504 + jj_consume_token(CLOSE_SINGLE_QUOTE_STRING);
    559 505   break;
    560 506   }
    561  - case OPEN_DOUBLE_QUOTE_STRING:{
    562  - jj_consume_token(OPEN_DOUBLE_QUOTE_STRING);
    563  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    564  - case DOUBLE_STRING_BODY:{
    565  - t = jj_consume_token(DOUBLE_STRING_BODY);
    566  - break;
    567  - }
    568  - default:
    569  - jj_la1[19] = jj_gen;
    570  - ;
    571  - }
    572  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    573  - case CLOSE_DOUBLE_QUOTE_STRING:{
    574  - jj_consume_token(CLOSE_DOUBLE_QUOTE_STRING);
    575  - break;
    576  - }
    577  - default:
    578  - jj_la1[20] = jj_gen;
     507 + default:
     508 + jj_la1[18] = jj_gen;
    579 509  {if (true) throw new ParseException("Missing closing quote for string.");}
     510 + }
     511 + break;
     512 + }
     513 + case OPEN_DOUBLE_QUOTE_STRING:{
     514 + jj_consume_token(OPEN_DOUBLE_QUOTE_STRING);
     515 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     516 + case DOUBLE_STRING_BODY:{
     517 + t = jj_consume_token(DOUBLE_STRING_BODY);
     518 + break;
    580 519   }
     520 + default:
     521 + jj_la1[19] = jj_gen;
     522 + ;
     523 + }
     524 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     525 + case CLOSE_DOUBLE_QUOTE_STRING:{
     526 + jj_consume_token(CLOSE_DOUBLE_QUOTE_STRING);
    581 527   break;
    582 528   }
    583 529   default:
    584  - jj_la1[21] = jj_gen;
    585  - jj_consume_token(-1);
    586  - throw new ParseException();
     530 + jj_la1[20] = jj_gen;
     531 +{if (true) throw new ParseException("Missing closing quote for string.");}
    587 532   }
     533 + break;
     534 + }
     535 + default:
     536 + jj_la1[21] = jj_gen;
     537 + jj_consume_token(-1);
     538 + throw new ParseException();
     539 + }
    588 540  if(t == null) {if ("" != null) return "";}
    589 541   else {if ("" != null) return org.apache.commons.text.StringEscapeUtils.unescapeJava(t.image);}
    590 542   throw new Error("Missing return statement in function");
    591  - } finally {
    592  - trace_return("String");
    593  - }
    594 543  }
    595 544   
    596  - final public Pattern RegexInString() throws ParseException { try {
    597  -Token t;
     545 + final public Pattern RegexInString() throws ParseException {Token t;
     546 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     547 + case OPEN_SINGLE_QUOTE_STRING:{
     548 + jj_consume_token(OPEN_SINGLE_QUOTE_STRING);
     549 + t = jj_consume_token(SINGLE_STRING_BODY);
    598 550   switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    599  - case OPEN_SINGLE_QUOTE_STRING:{
    600  - jj_consume_token(OPEN_SINGLE_QUOTE_STRING);
    601  - t = jj_consume_token(SINGLE_STRING_BODY);
    602  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    603  - case CLOSE_SINGLE_QUOTE_STRING:{
    604  - jj_consume_token(CLOSE_SINGLE_QUOTE_STRING);
    605  - break;
    606  - }
    607  - default:
    608  - jj_la1[22] = jj_gen;
    609  -{if (true) throw new ParseException("Missing closing quote for regex string.");}
    610  - }
     551 + case CLOSE_SINGLE_QUOTE_STRING:{
     552 + jj_consume_token(CLOSE_SINGLE_QUOTE_STRING);
    611 553   break;
    612 554   }
    613  - case OPEN_DOUBLE_QUOTE_STRING:{
    614  - jj_consume_token(OPEN_DOUBLE_QUOTE_STRING);
    615  - t = jj_consume_token(DOUBLE_STRING_BODY);
    616  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    617  - case CLOSE_DOUBLE_QUOTE_STRING:{
    618  - jj_consume_token(CLOSE_DOUBLE_QUOTE_STRING);
    619  - break;
    620  - }
    621  - default:
    622  - jj_la1[23] = jj_gen;
     555 + default:
     556 + jj_la1[22] = jj_gen;
    623 557  {if (true) throw new ParseException("Missing closing quote for regex string.");}
    624  - }
     558 + }
     559 + break;
     560 + }
     561 + case OPEN_DOUBLE_QUOTE_STRING:{
     562 + jj_consume_token(OPEN_DOUBLE_QUOTE_STRING);
     563 + t = jj_consume_token(DOUBLE_STRING_BODY);
     564 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     565 + case CLOSE_DOUBLE_QUOTE_STRING:{
     566 + jj_consume_token(CLOSE_DOUBLE_QUOTE_STRING);
    625 567   break;
    626 568   }
    627 569   default:
    628  - jj_la1[24] = jj_gen;
    629  - jj_consume_token(-1);
    630  - throw new ParseException();
     570 + jj_la1[23] = jj_gen;
     571 +{if (true) throw new ParseException("Missing closing quote for regex string.");}
    631 572   }
     573 + break;
     574 + }
     575 + default:
     576 + jj_la1[24] = jj_gen;
     577 + jj_consume_token(-1);
     578 + throw new ParseException();
     579 + }
    632 580  {if ("" != null) return Pattern.compile(t.image, Pattern.CASE_INSENSITIVE);}
    633 581   throw new Error("Missing return statement in function");
    634  - } finally {
    635  - trace_return("RegexInString");
    636  - }
    637 582  }
    638 583   
    639  - final public Pattern RegexInForwardSlashes() throws ParseException { try {
    640  -Token t;
    641  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    642  - case REGEXLITERAL_IN_FORWARD_SLASHES:{
    643  - t = jj_consume_token(REGEXLITERAL_IN_FORWARD_SLASHES);
    644  - break;
    645  - }
    646  - case REGEX_IN_FORWARD_SLASHES:{
    647  - t = jj_consume_token(REGEX_IN_FORWARD_SLASHES);
    648  - break;
    649  - }
    650  - default:
    651  - jj_la1[25] = jj_gen;
    652  - jj_consume_token(-1);
    653  - throw new ParseException();
     584 + final public Pattern RegexInForwardSlashes() throws ParseException {Token t;
     585 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     586 + case REGEXLITERAL_IN_FORWARD_SLASHES:{
     587 + t = jj_consume_token(REGEXLITERAL_IN_FORWARD_SLASHES);
     588 + break;
     589 + }
     590 + case REGEX_IN_FORWARD_SLASHES:{
     591 + t = jj_consume_token(REGEX_IN_FORWARD_SLASHES);
     592 + break;
    654 593   }
     594 + default:
     595 + jj_la1[25] = jj_gen;
     596 + jj_consume_token(-1);
     597 + throw new ParseException();
     598 + }
    655 599  {if ("" != null) return Pattern.compile(t.image.substring(1,t.image.length()-1), Pattern.CASE_INSENSITIVE);}
    656 600   throw new Error("Missing return statement in function");
    657  - } finally {
    658  - trace_return("RegexInForwardSlashes");
    659  - }
    660 601  }
    661 602   
    662  - final public Boolean Boolean() throws ParseException { try {
    663  -Token t, inverse=null;
    664  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    665  - case INVERSE:{
    666  - inverse = jj_consume_token(INVERSE);
    667  - break;
    668  - }
    669  - default:
    670  - jj_la1[26] = jj_gen;
    671  - ;
     603 + final public Boolean Boolean() throws ParseException {Token t, inverse=null;
     604 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     605 + case INVERSE:{
     606 + inverse = jj_consume_token(INVERSE);
     607 + break;
    672 608   }
    673  - t = jj_consume_token(BOOLEAN);
     609 + default:
     610 + jj_la1[26] = jj_gen;
     611 + ;
     612 + }
     613 + t = jj_consume_token(BOOLEAN);
    674 614  {if ("" != null) return (inverse != null ^ Boolean.parseBoolean(t.image));}
    675 615   throw new Error("Missing return statement in function");
    676  - } finally {
    677  - trace_return("Boolean");
    678  - }
    679 616  }
    680 617   
    681 618  //END TYPES
    skipped 1 lines
    683 620   
    684 621  //BASIC OPERATORS
    685 622   final public
    686  -Operator EqualityOperator() throws ParseException { try {
    687  - 
    688  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    689  - case EQ:{
    690  - jj_consume_token(EQ);
     623 +Operator EqualityOperator() throws ParseException {
     624 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     625 + case EQ:{
     626 + jj_consume_token(EQ);
    691 627  {if ("" != null) return Operator.EQUAL;}
    692  - break;
    693  - }
    694  - case NEQ:{
    695  - jj_consume_token(NEQ);
     628 + break;
     629 + }
     630 + case NEQ:{
     631 + jj_consume_token(NEQ);
    696 632  {if ("" != null) return Operator.NOT_EQUAL;}
    697  - break;
    698  - }
    699  - default:
    700  - jj_la1[27] = jj_gen;
    701  - jj_consume_token(-1);
    702  - throw new ParseException();
     633 + break;
    703 634   }
    704  - throw new Error("Missing return statement in function");
    705  - } finally {
    706  - trace_return("EqualityOperator");
     635 + default:
     636 + jj_la1[27] = jj_gen;
     637 + jj_consume_token(-1);
     638 + throw new ParseException();
    707 639   }
     640 + throw new Error("Missing return statement in function");
    708 641  }
    709 642   
    710  - final public Operator NumericOperator() throws ParseException { try {
    711  - 
    712  - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
    713  - case GT:{
    714  - jj_consume_token(GT);
     643 + final public Operator NumericOperator() throws ParseException {
     644 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
     645 + case GT:{
     646 + jj_consume_token(GT);
    715 647  {if ("" != null) return Operator.GREATER_THAN;}
    716  - break;
    717  - }
    718  - case LT:{
    719  - jj_consume_token(LT);
     648 + break;
     649 + }
     650 + case LT:{
     651 + jj_consume_token(LT);
    720 652  {if ("" != null) return Operator.LESS_THAN;}
    721  - break;
    722  - }
    723  - case GEQ:{
    724  - jj_consume_token(GEQ);
     653 + break;
     654 + }
     655 + case GEQ:{
     656 + jj_consume_token(GEQ);
    725 657  {if ("" != null) return Operator.GREATER_THAN_EQUAL;}
    726  - break;
    727  - }
    728  - case LEQ:{
    729  - jj_consume_token(LEQ);
     658 + break;
     659 + }
     660 + case LEQ:{
     661 + jj_consume_token(LEQ);
    730 662  {if ("" != null) return Operator.LESS_THAN_EQUAL;}
    731  - break;
    732  - }
    733  - default:
    734  - jj_la1[28] = jj_gen;
    735  - jj_consume_token(-1);
    736  - throw new ParseException();
     663 + break;
    737 664   }
     665 + default:
     666 + jj_la1[28] = jj_gen;
     667 + jj_consume_token(-1);
     668 + throw new ParseException();
     669 + }
    738 670   throw new Error("Missing return statement in function");
    739  - } finally {
    740  - trace_return("NumericOperator");
    741  - }
    742 671  }
    743 672   
    744  - final public Operator ContainsOperator() throws ParseException { try {
    745  - 
    746  - jj_consume_token(CONTAINS);
     673 + final public Operator ContainsOperator() throws ParseException {
     674 + jj_consume_token(CONTAINS);
    747 675  {if ("" != null) return Operator.CONTAINS;}
    748 676   throw new Error("Missing return statement in function");
    749  - } finally {
    750  - trace_return("ContainsOperator");
    751  - }
    752 677  }
    753 678   
    754  - final public Operator MatchesOperator() throws ParseException { try {
    755  - 
    756  - jj_consume_token(MATCHES);
     679 + final public Operator MatchesOperator() throws ParseException {
     680 + jj_consume_token(MATCHES);
    757 681  {if ("" != null) return Operator.MATCHES;}
    758 682   throw new Error("Missing return statement in function");
    759  - } finally {
    760  - trace_return("MatchesOperator");
    761  - }
    762 683  }
    763 684   
    764  - final public Operator InOperator() throws ParseException { try {
    765  - 
    766  - jj_consume_token(IN);
     685 + final public Operator InOperator() throws ParseException {
     686 + jj_consume_token(IN);
    767 687  {if ("" != null) return Operator.IN;}
    768 688   throw new Error("Missing return statement in function");
    769  - } finally {
    770  - trace_return("InOperator");
    771  - }
    772 689  }
    773 690   
    774  - final public boolean Inverse() throws ParseException { try {
    775  - 
    776  - jj_consume_token(INVERSE);
     691 + final public boolean Inverse() throws ParseException {
     692 + jj_consume_token(INVERSE);
    777 693  {if ("" != null) return true;}
    778 694   throw new Error("Missing return statement in function");
    779  - } finally {
    780  - trace_return("Inverse");
    781  - }
    782 695  }
    783 696   
    784  - final public BooleanOperator And() throws ParseException { try {
    785  - 
    786  - jj_consume_token(AND);
     697 + final public BooleanOperator And() throws ParseException {
     698 + jj_consume_token(AND);
    787 699  {if ("" != null) return BooleanOperator.AND;}
    788 700   throw new Error("Missing return statement in function");
    789  - } finally {
    790  - trace_return("And");
    791  - }
    792 701  }
    793 702   
    794  - final public BooleanOperator Or() throws ParseException { try {
    795  - 
    796  - jj_consume_token(OR);
     703 + final public BooleanOperator Or() throws ParseException {
     704 + jj_consume_token(OR);
    797 705  {if ("" != null) return BooleanOperator.OR;}
    798 706   throw new Error("Missing return statement in function");
    799  - } finally {
    800  - trace_return("Or");
    801  - }
    802 707  }
    803 708   
    804  - final public BooleanOperator Xor() throws ParseException { try {
    805  - 
    806  - jj_consume_token(XOR);
     709 + final public BooleanOperator Xor() throws ParseException {
     710 + jj_consume_token(XOR);
    807 711  {if ("" != null) return BooleanOperator.XOR;}
    808 712   throw new Error("Missing return statement in function");
    809  - } finally {
    810  - trace_return("Xor");
    811  - }
    812 713  }
    813 714   
    814 715   private boolean jj_2_1(int xla)
    skipped 26 lines
    841 742   return false;
    842 743   }
    843 744   
    844  - private boolean jj_3R_27()
     745 + private boolean jj_3R_12()
    845 746   {
    846  - if (jj_3R_33()) return true;
     747 + if (jj_scan_token(AND)) return true;
    847 748   return false;
    848 749   }
    849 750   
    850  - private boolean jj_3R_12()
     751 + private boolean jj_3R_27()
    851 752   {
    852  - if (jj_scan_token(AND)) return true;
     753 + if (jj_3R_33()) return true;
    853 754   return false;
    854 755   }
    855 756   
    skipped 9 lines
    865 766   return false;
    866 767   }
    867 768   
    868  - private boolean jj_3R_25()
     769 + private boolean jj_3R_22()
    869 770   {
    870  - if (jj_3R_8()) return true;
     771 + if (jj_scan_token(INVERSE)) return true;
    871 772   return false;
    872 773   }
    873 774   
    874  - private boolean jj_3R_22()
     775 + private boolean jj_3R_25()
    875 776   {
    876  - if (jj_scan_token(INVERSE)) return true;
     777 + if (jj_3R_8()) return true;
    877 778   return false;
    878 779   }
    879 780   
    skipped 61 lines
    941 842   return false;
    942 843   }
    943 844   
    944  - private boolean jj_3R_23()
     845 + private boolean jj_3R_35()
    945 846   {
    946  - if (jj_scan_token(ALIAS_SYMBOL)) return true;
     847 + if (jj_scan_token(CONTAINS)) return true;
    947 848   return false;
    948 849   }
    949 850   
    950  - private boolean jj_3R_35()
     851 + private boolean jj_3R_23()
    951 852   {
    952  - if (jj_scan_token(CONTAINS)) return true;
     853 + if (jj_scan_token(ALIAS_SYMBOL)) return true;
    953 854   return false;
    954 855   }
    955 856   
    skipped 24 lines
    980 881   return false;
    981 882   }
    982 883   
     884 + private boolean jj_3R_43()
     885 + {
     886 + if (jj_scan_token(LEQ)) return true;
     887 + return false;
     888 + }
     889 + 
    983 890   private boolean jj_3R_3()
    984 891   {
    985 892   Token xsp;
    skipped 6 lines
    992 899   }
    993 900   }
    994 901   if (jj_3R_7()) return true;
    995  - return false;
    996  - }
    997  - 
    998  - private boolean jj_3R_43()
    999  - {
    1000  - if (jj_scan_token(LEQ)) return true;
    1001 902   return false;
    1002 903   }
    1003 904   
    skipped 32 lines
    1036 937   return false;
    1037 938   }
    1038 939   
     940 + private boolean jj_3R_39()
     941 + {
     942 + if (jj_scan_token(NEQ)) return true;
     943 + return false;
     944 + }
     945 + 
    1039 946   private boolean jj_3R_18()
    1040 947   {
    1041 948   Token xsp;
    skipped 8 lines
    1050 957   private boolean jj_3R_20()
    1051 958   {
    1052 959   if (jj_3R_23()) return true;
    1053  - return false;
    1054  - }
    1055  - 
    1056  - private boolean jj_3R_39()
    1057  - {
    1058  - if (jj_scan_token(NEQ)) return true;
    1059 960   return false;
    1060 961   }
    1061 962   
    skipped 133 lines
    1195 1096   private boolean jj_rescan = false;
    1196 1097   private int jj_gc = 0;
    1197 1098   
    1198  - {
    1199  - enable_tracing();
    1200  - }
    1201 1099   /** Constructor with InputStream. */
    1202 1100   public FilterParser(java.io.InputStream stream) {
    1203 1101   this(stream, null);
    skipped 94 lines
    1298 1196   }
    1299 1197   }
    1300 1198   }
    1301  - trace_token(token, "");
    1302 1199   return token;
    1303 1200   }
    1304 1201   token = oldToken;
    skipped 32 lines
    1337 1234   else token = token.next = token_source.getNextToken();
    1338 1235   jj_ntk = -1;
    1339 1236   jj_gen++;
    1340  - trace_token(token, " (in getNextToken)");
    1341 1237   return token;
    1342 1238   }
    1343 1239   
    skipped 103 lines
    1447 1343   return trace_enabled;
    1448 1344   }
    1449 1345   
    1450  -/** Enable tracing. */
     1346 + /** Enable tracing. */
    1451 1347   final public void enable_tracing() {
    1452  - trace_enabled = true;
    1453 1348   }
    1454 1349   
    1455  -/** Disable tracing. */
     1350 + /** Disable tracing. */
    1456 1351   final public void disable_tracing() {
    1457  - trace_enabled = false;
    1458  - }
    1459  - 
    1460  - protected void trace_call(String s) {
    1461  - if (trace_enabled) {
    1462  - for (int i = 0; i < trace_indent; i++) { System.out.print(" "); }
    1463  - System.out.println("Call: " + s);
    1464  - }
    1465  - trace_indent = trace_indent + 2;
    1466  - }
    1467  - 
    1468  - protected void trace_return(String s) {
    1469  - trace_indent = trace_indent - 2;
    1470  - if (trace_enabled) {
    1471  - for (int i = 0; i < trace_indent; i++) { System.out.print(" "); }
    1472  - System.out.println("Return: " + s);
    1473  - }
    1474  - }
    1475  - 
    1476  - protected void trace_token(Token t, String where) {
    1477  - if (trace_enabled) {
    1478  - for (int i = 0; i < trace_indent; i++) { System.out.print(" "); }
    1479  - System.out.print("Consumed token: <" + tokenImage[t.kind]);
    1480  - if (t.kind != 0 && !tokenImage[t.kind].equals("\"" + t.image + "\"")) {
    1481  - System.out.print(": \"" + TokenMgrError.addEscapes(t.image) + "\"");
    1482  - }
    1483  - System.out.println(" at line " + t.beginLine + " column " + t.beginColumn + ">" + where);
    1484  - }
    1485  - }
    1486  - 
    1487  - protected void trace_scan(Token t1, int t2) {
    1488  - if (trace_enabled) {
    1489  - for (int i = 0; i < trace_indent; i++) { System.out.print(" "); }
    1490  - System.out.print("Visited token: <" + tokenImage[t1.kind]);
    1491  - if (t1.kind != 0 && !tokenImage[t1.kind].equals("\"" + t1.image + "\"")) {
    1492  - System.out.print(": \"" + TokenMgrError.addEscapes(t1.image) + "\"");
    1493  - }
    1494  - System.out.println(" at line " + t1.beginLine + " column " + t1.beginColumn + ">; Expected token: <" + tokenImage[t2] + ">");
    1495  - }
    1496 1352   }
    1497 1353   
    1498 1354   private void jj_rescan_token() {
    skipped 43 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/com/nccgroup/loggerplusplus/logentry/LogEntryField.java
    skipped 4 lines
    5 5  public enum LogEntryField {
    6 6   
    7 7   //Proxy
    8  - NUMBER(FieldGroup.PROXY, Integer.class, "", "Number"),
    9  - PROXY_TOOL(FieldGroup.PROXY, String.class, "", "Tool"),
    10  - LISTENER_INTERFACE(FieldGroup.PROXY, String.class, "", "ListenInterface", "Interface"),
    11  - CLIENT_IP(FieldGroup.PROXY, String.class, "", "ClientIP", "ClientAddress"),
    12  - USES_COOKIE_JAR_PROXY(FieldGroup.PROXY, String.class, "", "UsesCookieJar", "CookieJar"),
    13  - COMMENT(FieldGroup.PROXY, String.class, "", "Comment"),
     8 + NUMBER(FieldGroup.PROXY, Integer.class, "Item table number. Not valid for filter use.", "Number"),
     9 + PROXY_TOOL(FieldGroup.PROXY, String.class, "Originating tool name. Extension generated requests will be displayed as \"Extender\".", "Tool"),
     10 + LISTENER_INTERFACE(FieldGroup.PROXY, String.class, "The interface the proxied message was delivered to.", "ListenInterface", "Interface"),
     11 + CLIENT_IP(FieldGroup.PROXY, String.class, "The requesting client IP address.", "ClientIP", "ClientAddress"),
     12 + USES_COOKIE_JAR_PROXY(FieldGroup.PROXY, String.class, "Compares the cookies with the cookie jar ones to see if any of them in use.", "UsesCookieJar", "CookieJar"),
     13 + COMMENT(FieldGroup.PROXY, String.class, "Comments set on the entry.", "Comment"),
    14 14   
    15 15   //Request + Response
    16  - REQUEST_HEADERS(FieldGroup.REQUEST, String.class, "", "Headers"),
    17  - RESPONSE_HEADERS(FieldGroup.RESPONSE, String.class, "", "Headers"),
    18  - REQUEST_BODY(FieldGroup.REQUEST, String.class, "", "Body"),
    19  - RESPONSE_BODY(FieldGroup.RESPONSE, String.class, "", "Body"),
    20  - REQUEST_TIME(FieldGroup.REQUEST, Date.class, "", "Time"),
    21  - RESPONSE_TIME(FieldGroup.RESPONSE, Date.class, "", "Time"),
    22  - REQUEST_LENGTH(FieldGroup.REQUEST, Integer.class, "", "Length"),
    23  - RESPONSE_LENGTH(FieldGroup.RESPONSE, Integer.class, "", "Length"),
     16 + REQUEST_HEADERS(FieldGroup.REQUEST, String.class, "The request line and associated headers.", "Headers", "Header"),
     17 + RESPONSE_HEADERS(FieldGroup.RESPONSE, String.class, "The status line and associated headers.", "Headers", "Header"),
     18 + REQUEST_BODY(FieldGroup.REQUEST, String.class, "The request body.", "Body"),
     19 + RESPONSE_BODY(FieldGroup.RESPONSE, String.class, "The response body.", "Body"),
     20 + REQUEST_TIME(FieldGroup.REQUEST, Date.class, "Date and time of inital request (as received by L++).", "Time"),
     21 + RESPONSE_TIME(FieldGroup.RESPONSE, Date.class, "Date and time of receiving the response (as received by L++).", "Time"),
     22 + REQUEST_LENGTH(FieldGroup.REQUEST, Integer.class, "The length of the received request.", "Length"),
     23 + RESPONSE_LENGTH(FieldGroup.RESPONSE, Integer.class, "The length of the received response.", "Length"),
    24 24   
    25 25   
    26 26   //Request
    27 27   REQUEST_TOOL(FieldGroup.REQUEST, String.class, "The tool used to initiate the request.", "Tool"), //Alias for proxy.tool
    28  - COMPLETE(FieldGroup.REQUEST, Boolean.class, "", "Complete", "isComplete"),
    29  - URL(FieldGroup.REQUEST, String.class, "", "URL"),
    30  - METHOD(FieldGroup.REQUEST, String.class, "", "Method"),
    31  - PATH(FieldGroup.REQUEST, String.class, "", "Path"),
    32  - QUERY(FieldGroup.REQUEST, String.class, "", "Query"),
    33  - PROTOCOL(FieldGroup.REQUEST, String.class, "", "Protocol"),
    34  - ISSSL(FieldGroup.REQUEST, Boolean.class, "", "IsSSL", "ssl"),
    35  - REQUEST_USES_COOKIE_JAR(FieldGroup.REQUEST, String.class, "", "UsesCookieJar", "CookieJar"), //Alias for proxy.usescookiejar
    36  - HOSTNAME(FieldGroup.REQUEST, String.class, "", "Hostname"),
    37  - HOST(FieldGroup.REQUEST, String.class, "", "Host"),
    38  - PORT(FieldGroup.REQUEST, Short.class, "", "Port"),
    39  - REQUEST_CONTENT_TYPE(FieldGroup.REQUEST, String.class, "", "ContentType", "Content_Type"),
    40  - EXTENSION(FieldGroup.REQUEST, String.class, "", "Extension"),
    41  - REFERRER(FieldGroup.REQUEST, String.class, "", "Referrer"),
    42  - HASPARAMS(FieldGroup.REQUEST, Boolean.class, "", "HasParams", "Has_Params"),
    43  - HASGETPARAM(FieldGroup.REQUEST, Boolean.class, "", "HasGetParam", "HasQueryString", "QueryString"),
    44  - HASPOSTPARAM(FieldGroup.REQUEST, Boolean.class, "", "HasPostParam", "HasPayload", "Payload"),
    45  - HASCOOKIEPARAM(FieldGroup.REQUEST, Boolean.class, "", "HasSentCookies"),
    46  - SENTCOOKIES(FieldGroup.REQUEST, Boolean.class, "", "CookieString", "SentCookies", "Cookies"),
     28 + COMPLETE(FieldGroup.REQUEST, Boolean.class, "Has a response been received?", "Complete", "isComplete"),
     29 + URL(FieldGroup.REQUEST, String.class, "The entire URL of the request.", "URL", "URI"),
     30 + METHOD(FieldGroup.REQUEST, String.class, "The request method used.", "Method"),
     31 + PATH(FieldGroup.REQUEST, String.class, "The path component of the requested URL.", "Path"),
     32 + QUERY(FieldGroup.REQUEST, String.class, "The query parameters of the requested URL.", "Query", "GetParams", "QueryParams"),
     33 + PROTOCOL(FieldGroup.REQUEST, String.class, "The protocol component of the requested URL.", "Protocol"),
     34 + ISSSL(FieldGroup.REQUEST, Boolean.class, "Did the request use SSL?", "IsSSL", "ssl"),
     35 + REQUEST_USES_COOKIE_JAR(FieldGroup.REQUEST, String.class, "Compares the cookies with the cookie jar ones to see if any of them in use.", "UsesCookieJar", "CookieJar"), //Alias for proxy.usescookiejar
     36 + HOSTNAME(FieldGroup.REQUEST, String.class, "The hostname component of the requested URL.", "Hostname"),
     37 + HOST(FieldGroup.REQUEST, String.class, "The protocol and hostname of the requested URL.", "Host"),
     38 + PORT(FieldGroup.REQUEST, Short.class, "The port the request was sent to.", "Port"),
     39 + REQUEST_CONTENT_TYPE(FieldGroup.REQUEST, String.class, "The content-type header sent to the server.", "ContentType", "Content_Type"),
     40 + EXTENSION(FieldGroup.REQUEST, String.class, "The URL extension used in the request.", "Extension"),
     41 + REFERRER(FieldGroup.REQUEST, String.class, "The referrer header value of the request.", "Referrer"),
     42 + HASPARAMS(FieldGroup.REQUEST, Boolean.class, "Did the request contain parameters?", "HasParams"),
     43 + HASGETPARAM(FieldGroup.REQUEST, Boolean.class, "Did the request contain get parameters?", "HasGetParam", "HasGetParams", "HasQueryString"),
     44 + HASPOSTPARAM(FieldGroup.REQUEST, Boolean.class, "Did the request contain post parameters?", "HasPostParam", "HasPayload", "Payload"),
     45 + HASCOOKIEPARAM(FieldGroup.REQUEST, Boolean.class, "Did the request contain cookies?", "HasSentCookies"),
     46 + SENTCOOKIES(FieldGroup.REQUEST, Boolean.class, "The value of the cookies header sent to the server.", "CookieString", "SentCookies", "Cookies"),
    47 47   
    48 48   
    49 49   //Response
    50  - STATUS(FieldGroup.RESPONSE, Short.class, "", "Status"),
    51  - RTT(FieldGroup.RESPONSE, Integer.class, "", "RTT", "TimeTaken"),
    52  - TITLE(FieldGroup.RESPONSE, String.class, "", "Title"),
    53  - RESPONSE_CONTENT_TYPE(FieldGroup.RESPONSE, String.class, "", "ContentType", "Content_Type"),
    54  - MIME_TYPE(FieldGroup.RESPONSE, String.class, "", "MimeType", "Mime_Type"),
    55  - INFERRED_TYPE(FieldGroup.RESPONSE, String.class, "", "InferredType", "Inferred_Type"),
    56  - HAS_SET_COOKIES(FieldGroup.RESPONSE, Boolean.class, "", "HasSetCookies", "Has_Set_Cookies"),
    57  - NEW_COOKIES(FieldGroup.RESPONSE, String.class, "", "NewCookies", "New_Cookies");
     50 + STATUS(FieldGroup.RESPONSE, Short.class, "The status code received in the response.", "Status", "StatusCode"),
     51 + RTT(FieldGroup.RESPONSE, Integer.class, "The round trip time (as calculated by L++, not 100% accurate).", "RTT", "TimeTaken"),
     52 + TITLE(FieldGroup.RESPONSE, String.class, "The HTTP response title.", "Title"),
     53 + RESPONSE_CONTENT_TYPE(FieldGroup.RESPONSE, String.class, "The content-type header sent by the server.", "ContentType", "Content_Type"),
     54 + INFERRED_TYPE(FieldGroup.RESPONSE, String.class, "The type inferred by the response content.", "InferredType", "Inferred_Type"),
     55 + MIME_TYPE(FieldGroup.RESPONSE, String.class, "The mime-type stated by the server.", "MimeType", "Mime"),
     56 + HAS_SET_COOKIES(FieldGroup.RESPONSE, Boolean.class, "Did the response set cookies?", "HasSetCookies", "DidSetCookies"),
     57 + NEW_COOKIES(FieldGroup.RESPONSE, String.class, "The new cookies sent by the server", "Cookies", "NewCookies", "New_Cookies");
    58 58   
    59 59   private static final HashMap<FieldGroup, HashMap<String, LogEntryField>> completeGroupFieldMap = new HashMap<>();
    60 60   private static final HashMap<FieldGroup, HashMap<String, LogEntryField>> shortGroupFieldMap = new HashMap<>();
    skipped 75 lines
  • ■ ■ ■ ■ ■ ■
    src/test/java/TestParser.java
    1 1  import com.coreyd97.BurpExtenderUtilities.DefaultGsonProvider;
    2 2  import com.nccgroup.loggerplusplus.logentry.LogEntry;
    3 3  import com.nccgroup.loggerplusplus.filter.parser.ASTExpression;
    4  -import com.nccgroup.loggerplusplus.filter.parser.FilterEvaluationVisitor;
    5  -import com.nccgroup.loggerplusplus.filter.parser.FilterParser;
    6 4   
    7 5  import java.io.BufferedReader;
    8 6  import java.io.IOException;
    skipped 26 lines
Please wait...
Page is in error, reload to recover