telegraf/plugins/inputs/http_response
Daniel Nelson 09153c815c
Move http_response headers to end of configuration.
If the subtable comes before other options, they will be placed in the
subtable.
2017-08-15 11:50:08 -07:00
..
README.md Move http_response headers to end of configuration. 2017-08-15 11:50:08 -07:00
http_response.go Move http_response headers to end of configuration. 2017-08-15 11:50:08 -07:00
http_response_test.go Add result_type field for http_response input (#2814) 2017-06-06 13:39:07 -07:00

README.md

Example Input Plugin

This input plugin will test HTTP/HTTPS connections.

Configuration:

# HTTP/HTTPS request given an address a method and a timeout
[[inputs.http_response]]
  ## Server address (default http://localhost)
  # address = "http://localhost"

  ## Set response_timeout (default 5 seconds)
  # response_timeout = "5s"

  ## HTTP Request Method
  # method = "GET"

  ## Whether to follow redirects from the server (defaults to false)
  # follow_redirects = false

  ## Optional HTTP Request Body
  # body = '''
  # {'fake':'data'}
  # '''

  ## Optional substring or regex match in body of the response
  # response_string_match = "\"service_status\": \"up\""
  # response_string_match = "ok"
  # response_string_match = "\".*_status\".?:.?\"up\""

  ## Optional SSL Config
  # ssl_ca = "/etc/telegraf/ca.pem"
  # ssl_cert = "/etc/telegraf/cert.pem"
  # ssl_key = "/etc/telegraf/key.pem"
  ## Use SSL but skip chain & host verification
  # insecure_skip_verify = false

  ## HTTP Request Headers (all values must be strings)
  # [inputs.http_response.headers]
  #   Host = "github.com"

Measurements & Fields:

  • http_response
    • response_time (float, seconds)
    • http_response_code (int) #The code received
    • result_type (string) # success, timeout, response_string_mismatch, connection_failed

Tags:

  • All measurements have the following tags:
    • server
    • method

Example Output:

http_response,method=GET,server=http://www.github.com http_response_code=200i,response_time=6.223266528 1459419354977857955