The basics: inputs and outputs

Every gor process is a pipeline: one or more inputs produce messages, one or more outputs consume them. You always specify at least one of each.

sudo gor --input-raw :8080 --output-http="http://staging.example.com"

Inputs

  • --input-raw :8080 — sniff HTTP on a port (pcap; typically sudo). See capturing.
  • --input-file requests.gor — read a capture. See files.
  • --input-tcp :28020 — receive from another Gor. See distributed.
  • --input-kafka-host / --input-kafka-topic — Kafka. See Kafka.
  • --input-dummy — emit GET / every second (for testing outputs).
  • --input-report export.db — reuse a report database with --output-report.

There is no --input-http flag in current source. Do not copy old wiki commands that use it.

Outputs

  • --output-http http://staging.example.com — replay as HTTP. See replaying.
  • --output-file requests.gor — write the Gor file format.
  • --output-tcp host:28020 — forward to another Gor.
  • --output-stdout / --output-null — print or drop (debug).
  • --output-kafka-host / --output-kafka-topic — Kafka.
  • --output-http-elasticsearch — request/response stats to ES (used with HTTP replay).
  • --output-ws — WebSocket forwarder (same idea as TCP).
  • --output-report report.html — HTML comparison report.
  • --output-binaryPRO binary replay.

Multiple outputs

By default every output gets a copy of the same traffic. --split-output round-robins instead.

sudo gor --input-raw :80 --output-http "http://staging.example.com" --output-http "http://dev.example.com"

sudo gor --input-raw :80 --split-output --output-http "http://a.example.com" --output-http "http://b.example.com"

PRO --recognize-tcp-sessions makes split session-aware. See PRO.

Rate limits on a plugin

Append |N or |N% to an input or output value. Absolute N is max messages per second. Percent is a random sample, except --input-file and Kafka input, where percent speeds up or slows down replay instead of dropping.

# Staging gets at most 10 replayed requests per second
gor --input-file requests.gor --output-http "http://staging.example.com|10"

# Forward ~10% of live requests
sudo gor --input-raw :80 --output-tcp "replay.local:28020|10%"

# Replay a file at 2x original timing
gor --input-file "requests.gor|200%" --output-http "http://staging.example.com"

|N%*R also replicates the plugin R times. Consistent user sampling uses --http-header-limiter / --http-param-limiter. See load testing and filtering.

Next: capture live HTTP.