Skip to content

🦔 Injest only those events satisfying the given filter conditions

License

Notifications You must be signed in to change notification settings

PostHog/posthog-filter-out-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦔 PostHog Filter Out Plugin

Ingest only those events satisfying the given filter conditions.

Configuration

This plugin configuration requires a JSON file containing an array of filter groups. Events matching any filter group will be kept, meaning there's an OR logic between groups. However, within each filter group, all conditions must be met (AND logic).

Example Filters:

1. Single Filter Group:
To keep events where all the following conditions are met:

  • Email does not contain yourcompany.com
  • Host is not localhost:8000
  • Browser version is greater than 100
[
  [
    {
      "property": "email",
      "type": "string",
      "operator": "not_contains",
      "value": "yourcompany.com"
    },
    {
      "property": "$host",
      "type": "string",
      "operator": "is_not",
      "value": "localhost:8000"
    },
    {
      "property": "$browser_version",
      "type": "number",
      "operator": "gt",
      "value": 100
    }
  ]
]

2. Multiple Filter Groups (OR Logic):
To keep events where:

  • Group 1: Email does not contain yourcompany.com and Host is not localhost:8000
  • OR
  • Group 2: Event Type is signup and Browser is Chrome
[
  [
    {
      "property": "email",
      "type": "string",
      "operator": "not_contains",
      "value": "yourcompany.com"
    },
    {
      "property": "$host",
      "type": "string",
      "operator": "is_not",
      "value": "localhost:8000"
    }
  ],
  [
    {
      "property": "$event_type",
      "type": "string",
      "operator": "is",
      "value": "signup"
    },
    {
      "property": "$browser",
      "type": "string",
      "operator": "is",
      "value": "Chrome"
    }
  ]
]

In this configuration, an event will be retained if it matches any of the specified groups.

Allowed Types and Their Operators

Type Operators
number gt, gte, lt, lte, eq, neq
string is, is_not, contains, not_contains, regex, not_regex
boolean is, is_not

License

MIT

About

🦔 Injest only those events satisfying the given filter conditions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.2%
  • JavaScript 3.8%