🎉 hyperglass 2.0 is here! This documentation is still in development, though.
Configuration
HTTP Device

hyperglass supports collecting output from a generic HTTP endpoint.

HTTP Configuration

ParameterTypeDefault ValueDescription
http.attribute_mapMappingMapping/dict of hyperglass query fields as keys, and hyperglass query field replacements as values.
http.basic_authMappingIf basic authentication is required, provide a mapping/dict containing the basic authentication username and password.
http.body_formatStringjsonBody format, options are json yaml xml text
http.follow_redirectsBooleanfalseFollow HTTP redirects from server.
http.headersMappingMapping/dict of http headers to append to requests.
http.methodStringGETHTTP method to use for requests.
http.pathString/HTTP URI/Path.
http.queryMappingMapping/Dict of URL Query Parameters.
http.retriesNumber0Number of retries to perform before request failure.
http.schemeStringhttpsHTTP schema, must be http or https
http.sourceStringRequest source IP address.
http.ssl_caStringPath to SSL CA certificate file for SSL validation.
http.ssl_clientStringPath to client SSL certificates for request.
http.timeoutNumber5Request timeout in seconds.
http.verify_sslBooleantrueIf false, invalid certificates for HTTPS hosts will be ignored.

Example

Basic

The following example will send an HTTP POST request to https://192.0.2/path/to/query/device with HTTP basic authentication, and will not verify the SSL certificate.

devices.yaml
devices:
    - name: New York, NY
      address: 192.0.2.1
      http:
          path: /path/to/query/device
          method: POST
          verify_ssl: false
          basic_auth:
              username: you
              password: your password

Given the following hyperglass query:

FieldValue
Query Target192.0.2.0/24
Query Locationyour_location
Query Typeexample_directive

The body of the request will be:

{
    "query_target": "192.0.2.0/24",
    "query_location": "your_location",
    "query_type": "example_directive"
}

Non-HTTPS Request

The following example will send an HTTP GET request to http://192.0.2.1/path/to/query/device:

devices.yaml
devices:
    - name: New York, NY
      address: 192.0.2.1
      http:
          path: /path/to/query/device
          scheme: http

Header Authentication

The following example will send an HTTP GET request to https://192.0.2.1/path/to/query/device with an Authorization header:

devices.yaml
devices:
    - name: New York, NY
      address: 192.0.2.1
      http:
          path: /path/to/query/device
          headers:
              Authorization: your special token