diff --git a/internal/portal/src/common/FilterSyntaxGuide/FilterSyntaxGuide.tsx b/internal/portal/src/common/FilterSyntaxGuide/FilterSyntaxGuide.tsx index 532a2969..521e0c10 100644 --- a/internal/portal/src/common/FilterSyntaxGuide/FilterSyntaxGuide.tsx +++ b/internal/portal/src/common/FilterSyntaxGuide/FilterSyntaxGuide.tsx @@ -6,17 +6,21 @@ Only events matching the filter will be delivered. Filters use JSON to define ma ## Event Structure -Events contain two top-level properties that can be filtered: +Events have five top-level properties that can be filtered: -- \`data\` — The event payload +- \`id\` — The event ID +- \`topic\` — The event topic +- \`time\` — Event timestamp (RFC3339 format) - \`metadata\` — Additional event information +- \`data\` — The event payload -Your filter should specify one or both of these at the top level: +Your filter should specify one or more of these at the top level: \`\`\`json { + "topic": "order.created", "data": { - "type": "order.created" + "status": "paid" }, "metadata": { "source": "api" @@ -116,6 +120,17 @@ Use operators for complex matching: } \`\`\` +**Example:** Match events within a time range + +\`\`\`json +{ + "time": { + "$gte": "2025-01-01T00:00:00Z", + "$lt": "2025-02-01T00:00:00Z" + } +} +\`\`\` + ## Combining Operators Multiple operators on the same field are combined with AND: