Usage
The command line interface is as follows:
snowplow-tracking-cli --collector={{COLLECTOR_DOMAIN}} --appid={{APP_ID}} --method=[POST|GET] --sdjson={{SELF_DESC_JSON}}
or:
snowplow-tracking-cli --collector={{COLLECTOR_DOMAIN}} --appid={{APP_ID}} --method=[POST|GET] --schema={{SCHEMA_URI}} --json={{JSON}}
where:
--collector
is the domain for your Snowplow collector, e.g.snowplow-collector.acme.com
--appid
is optional (not sent if not set)--method
is optional. It defaults toGET
--protocol
is optional. It defaults tohttps
--sdjson
is a self-describing JSON of the standard form{ "schema": "iglu:...", "data": { ... } }
--schema
is a schema URI, most likely of the formiglu:...
--json
is a (non-self-describing) JSON, of the form{ ... }
--ipaddress
is optional. It defaults to an empty string--contexts
is optional. It defaults to an empty JSON array[]
The idea here is that you can either send in a self-describing JSON, or pass in the constituent parts (i.e. a regular JSON plus a schema URI) and the Snowplow Tracking CLI will construct the final self-describing JSON for you.
Examples
snowplow-tracking-cli --collector snowplow-collector.acme.com --appid myappid --method POST --schema iglu:com.snowplowanalytics.snowplow/event/jsonschema/1-0-0 --json "{\"hello\":\"world\"}"
snowplow-tracking-cli --collector snowplow-collector.acme.com --appid myappid --method POST --sdjson "{\"schema\":\"iglu:com.snowplowanalytics.snowplow/event/jsonschema/1-0-0\", \"data\":{\"hello\":\"world\"}}"
Usage with Docker
docker run snowplow/snowplow-tracking-cli:latest --collector snowplow-collector.acme.com --appid myappid --method POST --sdjson "{\"schema\":\"iglu:com.snowplowanalytics.snowplow/event/jsonschema/1-0-0\", \"data\":{\"hello\":\"world\"}}"