diff --git a/changelog/unreleased/issue-18017.toml b/changelog/unreleased/issue-18017.toml new file mode 100644 index 000000000000..10c3e4c65839 --- /dev/null +++ b/changelog/unreleased/issue-18017.toml @@ -0,0 +1,5 @@ +type = "f" +message = "Reverts fix for #16029 due to regression in GeoIP lookup table access." + +issues = ["18017"] +pulls = ["18322"] diff --git a/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/parser/PipelineRuleParser.java b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/parser/PipelineRuleParser.java index d8340d7d7642..7b3c6d0c92d6 100644 --- a/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/parser/PipelineRuleParser.java +++ b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/parser/PipelineRuleParser.java @@ -22,6 +22,7 @@ import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.swrve.ratelimitedlogger.RateLimitedLog; +import jakarta.inject.Inject; import org.antlr.v4.runtime.ANTLRInputStream; import org.antlr.v4.runtime.BaseErrorListener; import org.antlr.v4.runtime.CommonTokenStream; @@ -73,7 +74,6 @@ import org.graylog.plugins.pipelineprocessor.parser.errors.IncompatibleIndexType; import org.graylog.plugins.pipelineprocessor.parser.errors.IncompatibleType; import org.graylog.plugins.pipelineprocessor.parser.errors.IncompatibleTypes; -import org.graylog.plugins.pipelineprocessor.parser.errors.InvalidFieldAccess; import org.graylog.plugins.pipelineprocessor.parser.errors.InvalidFunctionArgument; import org.graylog.plugins.pipelineprocessor.parser.errors.InvalidOperation; import org.graylog.plugins.pipelineprocessor.parser.errors.MissingRequiredParam; @@ -89,8 +89,6 @@ import org.joda.time.Duration; import org.joda.time.Period; -import jakarta.inject.Inject; - import java.util.ArrayDeque; import java.util.HashMap; import java.util.IdentityHashMap; @@ -436,9 +434,6 @@ public void exitNested(RuleLangParser.NestedContext ctx) { isIdIsFieldAccess.pop(); // reset for error checks final Expression object = exprs.get(ctx.fieldSet); final Expression field = exprs.get(ctx.field); - if (field instanceof ArrayLiteralExpression) { - parseContext.addError(new InvalidFieldAccess(ctx, field)); - } final FieldAccessExpression expr = new FieldAccessExpression(ctx.getStart(), object, field); log.trace("FIELDACCESS: ctx {} => {}", ctx, expr); exprs.put(ctx, expr); diff --git a/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/parser/errors/InvalidFieldAccess.java b/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/parser/errors/InvalidFieldAccess.java deleted file mode 100644 index 5b927d2905b3..000000000000 --- a/graylog2-server/src/main/java/org/graylog/plugins/pipelineprocessor/parser/errors/InvalidFieldAccess.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2020 Graylog, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * . - */ -package org.graylog.plugins.pipelineprocessor.parser.errors; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.graylog.plugins.pipelineprocessor.ast.expressions.Expression; -import org.graylog.plugins.pipelineprocessor.parser.RuleLangParser; - -public class InvalidFieldAccess extends ParseError { - - private final Expression expression; - - public InvalidFieldAccess(RuleLangParser.NestedContext ctx, - Expression expression) { - super("invalid_field_access", ctx); - this.expression = expression; - } - - @JsonProperty("reason") - @Override - public String toString() { - return "Error accessing map field " + expression.toString() + ". Please use either dot or square bracket notation" + positionString(); - } -}