All Projects → HatsuneMiku3939 → fluent-plugin-http-pull

HatsuneMiku3939 / fluent-plugin-http-pull

Licence: Apache-2.0 license
The input plugin of fluentd to pull log from rest api.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to fluent-plugin-http-pull

Human Interval
Human readable time distances for javascript
Stars: ✭ 360 (+1794.74%)
Mutual labels:  parse, interval
fluent-plugin-multiprocess
Multiprocess agent plugin for Fluentd
Stars: ✭ 42 (+121.05%)
Mutual labels:  fluentd, fluentd-plugin
fluent-plugin-windows-eventlog
Fluentd plugin to collect windows event logs
Stars: ✭ 27 (+42.11%)
Mutual labels:  fluentd, fluentd-plugin
fluent-plugin-gcs
Google Cloud Storage output plugin for Fluentd.
Stars: ✭ 39 (+105.26%)
Mutual labels:  fluentd, fluentd-plugin
fluent-plugin-grok-parser
Fluentd's Grok parser
Stars: ✭ 100 (+426.32%)
Mutual labels:  fluentd, fluentd-plugin
fluentd-plugin-mdsd
Azure Linux monitoring agent (mdsd) output plugin for fluentd
Stars: ✭ 26 (+36.84%)
Mutual labels:  fluentd, fluentd-plugin
fluent-plugin-webhdfs
Hadoop WebHDFS output plugin for Fluentd
Stars: ✭ 57 (+200%)
Mutual labels:  fluentd, fluentd-plugin
fluent-plugin-redis
Redis output plugin for Fluent event collector
Stars: ✭ 40 (+110.53%)
Mutual labels:  fluentd, fluentd-plugin
fluent-plugin-ec2-metadata
Fluentd output plugin to add Amazon EC2 metadata into messages
Stars: ✭ 43 (+126.32%)
Mutual labels:  fluentd, fluentd-plugin
fluent-plugin-rabbitmq
Fluent input/output plugin for RabbitMQ.
Stars: ✭ 26 (+36.84%)
Mutual labels:  fluentd, fluentd-plugin
php-simple-request
php-simple-request is a request parser library designed to simplify requests validation and filtering using annotations, generating at the same time an object representation from the request data.
Stars: ✭ 15 (-21.05%)
Mutual labels:  parse
irsync
rsync on interval, via command line binary or docker container. Server and IOT builds for pull or push based device content management.
Stars: ✭ 19 (+0%)
Mutual labels:  interval
limelight
A php Japanese language text analyzer and parser.
Stars: ✭ 76 (+300%)
Mutual labels:  parse
icc
JavaScript module to parse International Color Consortium (ICC) profiles
Stars: ✭ 37 (+94.74%)
Mutual labels:  parse
xml-spac
Handle streaming XML data with declarative, composable parsers
Stars: ✭ 39 (+105.26%)
Mutual labels:  parse
logwatch
日志采集工具
Stars: ✭ 22 (+15.79%)
Mutual labels:  fluentd
parse-csv
CSV parser for node.js
Stars: ✭ 15 (-21.05%)
Mutual labels:  parse
MOTE
Magnitude of the Effect - An Effect Size and CI calculator
Stars: ✭ 17 (-10.53%)
Mutual labels:  interval
interval
This PHP library provides some tools to handle intervals. For instance, you can compute the union or intersection of two intervals.
Stars: ✭ 25 (+31.58%)
Mutual labels:  interval
Astview
Astview is a graphical viewer for abstract syntax trees
Stars: ✭ 20 (+5.26%)
Mutual labels:  parse

fluent-plugin-http-pull

Build Status Build status Gem Version Gem Downloads Coverage Status

Fluentd input plugin to pull log from rest api.

Many of modern server application offer status reporting API via http (even 'fluentd' too). This plugin will help to gathering status log from these status api.

Installation

RubyGems

$ gem install fluent-plugin-http-pull

Bundler

Add following line to your Gemfile:

gem "fluent-plugin-http-pull"

And then execute:

$ bundle

Usage

basic usage

In your Fluentd configuration, use @type http_pull. tag, url, interval, format is mandatory configuration.

<source>
	@type http_pull

	tag status
	url http://your-infrastructure/api/status.json
	interval 1s

	format json
</source>

# 2017-05-17 21:41:47.872951000 +0900 status: {"url":"http://yourinfrastructure/api/status.json","status":200,"message":{ ... }}

In this example, a response of your infrastructure parsed as json. A result contains url, status, message. message is a response of your infrastructure.

{
	"url": "http://your-infrastructure/api/status.json",
	"status": 200,
	"message": {
		// response of your infra structure
	}
}

You can found more examples in this document.

Monitoring http status code only

If you need only http status code, not response body, You can turn off response body parser to set status_only is true. Remember that format is mandatory. In this case, you must set format is none.

<source>
	@type http_pull

	tag fluentd.status
	url http://your-infrastructure/healthcheck
	interval 1s

	status_only true
	format none
</source>

# 2017-05-17 21:41:47.872951000 +0900 status: {"url":"http://yourinfrastructure/healthcheck","status":200}

Override User Agent

You can set the User Agent by specifying the agent option.

<source>
	@type http_pull

	tag status
	url http://your-infrastructure/api/status.json
	interval 1s

	format json
	agent infrastructure_monitor
</source>

# 2017-05-17 21:41:47.872951000 +0900 status: {"url":"http://yourinfrastructure/api/status.json","status":200,"message":{ ... }}

HTTP basic auth

If your infrastructure is protected by HTTP basic auth, You can use user, password options to provide authentication information.

<source>
	@type http_pull

	tag status
	url http://your-infrastructure/api/status.json
	interval 1s

	format json
	user foo
	password bar
</source>

# 2017-05-17 21:41:47.872951000 +0900 status: {"url":"http://yourinfrastructure/api/status.json","status":200,"message":{ ... }}

HTTP proxy

You can send your requests via proxy server.

<source>
	@type http_pull

	tag status
	url http://your-infrastructure/api/status.json
	proxy http://your-proxy-server:3128
	interval 1s

	format json
</source>

# 2017-05-17 21:41:47.872951000 +0900 status: {"url":"http://yourinfrastructure/api/status.json","status":200,"message":{ ... }}

Logging HTTP response header

If you wish to monitoring not only response body but also response header, provide name of header in response_header sections.

<source>
	@type http_pull

	tag status
	url http://your-infrastructure/api/status.json
	interval 1s

	format json

	<response_header>
		header Content-Type
	</response_header>

	<response_header>
		header Content-Length
	</response_header>
</source>

# 2017-05-17 21:41:47.872951000 +0900 status: {"url":"http://yourinfrastructure/api/status.json","status":200,"message":{ ... }}

Custom request header

The custom request header also supported. This will help you when your infrastructure needs authentication headers or something like that.

<source>
	@type http_pull

	tag status
	url http://your-infrastructure/api/status.json
	interval 1s

	format json

	<request_header>
		header API_ACCESS_KEY
		value hatsune
	</request_header>

	<response_header>
		header API_ACCESS_KEY_SECRET
		value miku
	</response_header>
</source>

# 2017-05-17 21:41:47.872951000 +0900 status: {"url":"http://yourinfrastructure/api/status.json","status":200,"message":{ ... }}

HTTPS support

If your infrastructure has https endpoints, just use https url for monitoring them.

self-signed SSL

If your infrastructure has https endpoints secured by self signed certification, you can provide custom certification file via ca_path, ca_file option.

<source>
	@type http_pull

	tag status
	url https://your-infrastructure/api/status.json
	interval 1s
	ca_path /somewhere/ca/stored
	ca_file /somewhere/ca/stored/server.crt

	format json
</source>

# 2017-05-17 21:41:47.872951000 +0900 status: {"url":"http://yourinfrastructure/api/status.json","status":200,"message":{ ... }}

And, disable SSL verification also supported. (not recommended)

<source>
	@type http_pull

	tag status
	url https://your-infrastructure/api/status.json
	interval 1s
	verify_ssl false

	format json
</source>

# 2017-05-17 21:41:47.872951000 +0900 status: {"url":"http://yourinfrastructure/api/status.json","status":200,"message":{ ... }}

Configuration

Basic Configuration

tag (string) (required)

The tag of the event.

url (string) (required)

The url of remote server.

agent (string) (optional, default: fluent-plugin-http-pull)

The user agent string of request.

interval (time) (required)

The interval time between periodic request.

format (required)

The format of the response body. Due to limitation of current implement it is always required regardless status_only option.

http_pull uses parse plugin to parse the response body. See parser article for more detail.

status_only (bool) (optional, default: false)

If status_only is true, body is not parsed.

http_method (enum) (optional, default: :get)

The http request method for each requests. Avaliable options are listed below.

  • get
  • post
  • delete

If status_only is true, http_method was override to head

timeout (time) (optional, default: 10s)

The timeout of each request.

Proxy Configuration

proxy (string) (optional, default: nil)

The HTTP proxy URL to use for each requests

Basic Auth Configuration

user (string) (optional, default: nil)

The user for basic auth

password (string) (optional, default: nil)

The password for basic auth

Req/Resp Header Configuration

response_header (section) (optional, default: nil)

The name of response header for capture.

request_header (section) (optional, default: nil)

The name, value pair of custom reuqest header.

SSL Configuration

verify_ssl (bool) (optional, default: true)

When false, SSL verification is ignored.

ca_path (string) (optional, defualt: nil)

The absolute path of directory where ca_file stored. Should be used with ca_file.

ca_file (string) (optional, defualt: nil)

The absolute path of ca_file. Should be used with ca_path.

Copyright

  • Copyright(c) 2017- filepang
  • License
    • Apache License, Version 2.0
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].