diff --git a/src/org/openstreetmap/josm/gui/autofilter/AutoFilterRule.java b/src/org/openstreetmap/josm/gui/autofilter/AutoFilterRule.java
index 9c35c387e9..f722122bd6 100644
--- a/src/org/openstreetmap/josm/gui/autofilter/AutoFilterRule.java
+++ b/src/org/openstreetmap/josm/gui/autofilter/AutoFilterRule.java
@@ -2,22 +2,22 @@
 package org.openstreetmap.josm.gui.autofilter;
 
 import java.text.DecimalFormat;
-import java.util.Arrays;
-import java.util.Locale;
-import java.util.Objects;
-import java.util.Optional;
+import java.util.*;
 import java.util.function.Function;
 import java.util.function.IntFunction;
 import java.util.function.ToIntFunction;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.IntStream;
+import java.util.stream.Stream;
 
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmUtils;
 import org.openstreetmap.josm.data.preferences.BooleanProperty;
 import org.openstreetmap.josm.tools.Logging;
 
+import static java.util.stream.Collectors.toList;
+
 /**
  * An auto filter rule determines how auto filter can be built from visible map data.
  * Several rules can be registered, but only one rule is active at the same time.
@@ -42,6 +42,9 @@ public class AutoFilterRule {
 
     private IntFunction<String> valueFormatter = Integer::toString;
 
+    /** The union of {@link #key} and the keys provided by {@link #setExtraKeys(List)}. */
+    private List<String> allKeys;
+
     /**
      * Constructs a new {@code AutoFilterRule}.
      * @param key the OSM key on which the rule applies
@@ -50,6 +53,7 @@ public class AutoFilterRule {
     public AutoFilterRule(String key, int minZoomLevel) {
         this.key = key;
         this.minZoomLevel = minZoomLevel;
+        this.allKeys = List.of(key);
     }
 
     /**
@@ -111,12 +115,40 @@ public class AutoFilterRule {
         return this;
     }
 
+    /**
+     * Sets extra OSM keys on which the rule applies in addition to the primary key ({@link #getKey()}).
+     * This allows a filter to look at the values of more than one key at the same time.
+     * @param extraKeys the list of extra keys, may be empty
+     * @return {@code this}
+     * @throws NullPointerException if {@code extraKeys} is null
+     */
+    public AutoFilterRule setExtraKeys(List<String> extraKeys) {
+        Objects.requireNonNull(extraKeys);
+        this.allKeys = Stream.concat(Stream.of(key), extraKeys.stream()).collect(toList());
+        return this;
+    }
+
     /**
      * Returns the numeric values for the given OSM primitive
      * @param osm the primitive
      * @return a stream of numeric values
      */
     public IntStream getTagValuesForPrimitive(OsmPrimitive osm) {
+        if (allKeys.size() == 1) {
+            IntStream values = getTagValuesForPrimitive(osm, key);
+            if (values != null) return values;
+        } else {
+            Set<Integer> allValues = new HashSet<>();
+            for (String k : allKeys) {
+                IntStream values = getTagValuesForPrimitive(osm, k);
+                if (values != null) { values.forEach(allValues::add); }
+            }
+            if (!allValues.isEmpty()) return allValues.stream().mapToInt(it -> it).sorted();
+        }
+        return Boolean.TRUE.equals(PROP_AUTO_FILTER_DEFAULTS.get()) ? defaultValueSupplier.apply(osm) : IntStream.empty();
+    }
+
+    private IntStream getTagValuesForPrimitive(OsmPrimitive osm, String key) {
         String value = osm.get(key);
         if (value != null) {
             Pattern p = Pattern.compile("(-?[0-9]+)-(-?[0-9]+)");
@@ -136,7 +168,7 @@ public class AutoFilterRule {
                 }
             });
         }
-        return Boolean.TRUE.equals(PROP_AUTO_FILTER_DEFAULTS.get()) ? defaultValueSupplier.apply(osm) : IntStream.empty();
+        return null;
     }
 
     /**
@@ -156,6 +188,7 @@ public class AutoFilterRule {
             new AutoFilterRule("layer", 16)
                     .setDefaultValueSupplier(AutoFilterRule::defaultLayer),
             new AutoFilterRule("level", 17)
+                .setExtraKeys(List.of("repeat_on"))
                 // #17109, support values like 0.5 or 1.5 - level values are multiplied by 2 when parsing, values are divided by 2 for formatting
                 .setValueExtractor(s -> (int) (Double.parseDouble(s) * 2.))
                 .setValueFormatter(v -> DecimalFormat.getInstance(Locale.ROOT).format(v / 2.)),
diff --git a/test/unit/org/openstreetmap/josm/gui/autofilter/AutoFilterRuleTest.java b/test/unit/org/openstreetmap/josm/gui/autofilter/AutoFilterRuleTest.java
index d68b4bcaec..ae1b15b909 100644
--- a/test/unit/org/openstreetmap/josm/gui/autofilter/AutoFilterRuleTest.java
+++ b/test/unit/org/openstreetmap/josm/gui/autofilter/AutoFilterRuleTest.java
@@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test;
 @I18n
 class AutoFilterRuleTest {
     /**
-     * Unit test of {@link AutoFilterRule#getTagValuesForPrimitive}.
+     * Unit test of {@link AutoFilterRule#getTagValuesForPrimitive(OsmPrimitive)}.
      */
     @Test
     void testTagValuesForPrimitive() {
@@ -36,12 +36,14 @@ class AutoFilterRuleTest {
         assertTagValuesForPrimitive(level, "way level=6-9", 12, 13, 14, 15, 16, 17, 18);
         assertTagValuesForPrimitive(level, "way level=10;12-13", 20, 24, 25, 26);
         assertTagValuesForPrimitive(level, "way level=0;0.5;1;1.5;2;2.5;3", 0, 1, 2, 3, 4, 5, 6);
+        assertTagValuesForPrimitive(level, "node level=0 repeat_on=1;2", 0, 2, 4);
+        assertTagValuesForPrimitive(level, "way level=4 repeat_on=4;5 layer=1", 8, 10);
         assertEquals("0 0.5 1 1.5 2 2.5 3",
                 IntStream.of(0, 1, 2, 3, 4, 5, 6).mapToObj(level::formatValue).collect(Collectors.joining(" ")));
     }
 
     /**
-     * Unit test of {@link AutoFilterRule#getTagValuesForPrimitive} to deal with {@code %} of key {@code incline}.
+     * Unit test of {@link AutoFilterRule#getTagValuesForPrimitive(OsmPrimitive)} to deal with {@code %} of key {@code incline}.
      */
     @Test
     void testTagValuesForPrimitiveInclineUnit() {
@@ -52,7 +54,7 @@ class AutoFilterRuleTest {
     }
 
     /**
-     * Unit test of {@link AutoFilterRule#getTagValuesForPrimitive} provides sensible defaults, see #17496.
+     * Unit test of {@link AutoFilterRule#getTagValuesForPrimitive(OsmPrimitive)} provides sensible defaults, see #17496.
      */
     @Test
     void testTagValuesForPrimitivesDefaults() {
