Skip to content

Example: HTTP relay

Lorenzo Mangani edited this page Sep 13, 2017 · 11 revisions

paStash can be used to spin up a simple HTTP Relay or Fork w/ optional filters and path routing

Setup

paStash itself needs to be installed in order to use this recipe:

# git clone https://github.com/sipcapture/paStash
# cd paStash/
# npm install

Recipe

There are two approaches to achieve distribution/forking of HTTP/S messages using paStash:

Single-Post, Multiple Targets
input {
  http {
    host => 127.0.0.1
    port => 8090
  }
}

output {
  http_post {
    host => ['10.0.0.1','10.0.0.2']
    port => 18090
    path => '#{path}'
  }
}
Multi-Post, Single Targets
input {
  http {
    host => 127.0.0.1
    port => 8090
  }
}

output {
  http_post {
    host => ['10.0.0.1']
    port => 18090
    path => '#{path}'
  }
  http_post {
    host => ['10.0.0.2']
    port => 18090
    path => '#{path}'
  }
}

Usage

./bin/pastash --config_file=/path/to/pastash_recipe.json
Clone this wiki locally