Build Status

Curator

Server that accepts Event via WebSocket or HTTP POST request. Filters them based on defined rules. Forwards thems to other nodes.

Available endpoints:

Upon start, server exposes two endpoints:

  1. /ingest Websocket endpoint which accepts Event in a json format.
  2. /ingest HTTP POST endpoint which accepts Event in bulk, where list of events are specified in ndjson format.

Starting server as crystal script

API_KEY=password CURATOR_ID=cur-45678 CURATOR_PEPPER=secret FORWARDS="ws://127.0.0.1:4444|secret_api_key" crystal run src/curator.cr

Configuration

Available Environment variables:

Event filtering rules:

Curator accepts rules in a yml format. Rules are defined in config/rules.yml for all Event attributes except Event.ref.

Event.ref rules are defined in config/ref_rules.yml

rules.yml example:

-
  attribute: "org"
  operation: "exclude"
  values:
    - fb
-
  attribute: "org"
  operation: "include"
  values:
    - microsoft
    - google
-
  attribute: "uts"
  operation: "greater_than_equal"
  values:
    - 1580276617006
-
  attribute: "uts"
  operation: "less_than_equal"
  values:
    - 1880276617000

ref_rules.yml example:

-
  attribute: "ref"
  operation: "exclude"
  values:
    - blank
    - [email protected]

Allowed Operators for Rules:

Available operators are Event attribute dependent.

Allowed values for Rules:

Development

To run specs crystal spec

Contributing

  1. Fork it (https://github.com/place-labs/curator/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request