Tooling for submitting JSON dumps of Puppet reports to ElasticSearch
Project description
# send_report_to_es
## Summary
Send a puppet report to ElasticSearch.
## Usage
### Command
~~~
send_report_to_es [-h|--help] <filename>
~~~
### Options
~~~
-h/--help Show this help text and exit
~~~
### Parameters
~~~
filename The JSON file for the report to load and send to ElasticSearch
~~~
## Configuring
Configuration is read from the file specified in the environment variable
`PUPPET_ES_CONFIG` (defaults to `/etc/puppet_es.conf`) and uses ConfigParser
syntax. A sample configuration file is included as
[`etc/puppet_es.conf.example`](etc/puppet_es.conf.example).
### Section: `base`
**`on_error`** (optional) What to do with the report file when we encounter a
parse error or an ElasticSearch error. Possible values:
* `delete` Delete the file off disk
* `archive` Move the file to the directory specified in `archive_dir`
* `ignore` Leave the file as-is (default)
**`on_success`** (optional) What to do with the report file after successfully
posting to ElasticSearch. Possible values:
* `delete` Delete the file off disk
* `archive` Move the file to the directory specified in `archive_dir`
* `ignore` Leave the file as-is (default)
**`archive_dir`** (conditionally required) The directory to move files into when
`archive` is set for `on_error` or `on_success`. Has no effect if neither of
those is set to `archive`, and is required if either is set to `archive`.
### Section: `elasticsearch`
**`host`** (required) The fully qualified domain name for connecting to
ElasticSearch over HTTP.
**`port`** (required) The port for connecting to ElasticSearch over HTTP.
### Section: `logging`
**`level`** (optional) What message level to log. Valid options are those
defined by the Python 2.7 `logging` module. Defaults to `WARNING`.
**`stderr`** (optional) Boolean value about whether to print log messages to
`stderr`. Defaults to `false`.
**`syslog`** (optional) Boolean value about whether to print log messages to
syslog. Defaults to `true`.
**`file`** (optional) Filename for a file to write log messages into. Defaults
to an empty value, meaning do not log to a file.
## Configuring ElasticSearch
An example ElasticSearch template that supports the format this script uses can
be found at [`etc/puppet_template.json`](etc/puppet_template.json).
## Summary
Send a puppet report to ElasticSearch.
## Usage
### Command
~~~
send_report_to_es [-h|--help] <filename>
~~~
### Options
~~~
-h/--help Show this help text and exit
~~~
### Parameters
~~~
filename The JSON file for the report to load and send to ElasticSearch
~~~
## Configuring
Configuration is read from the file specified in the environment variable
`PUPPET_ES_CONFIG` (defaults to `/etc/puppet_es.conf`) and uses ConfigParser
syntax. A sample configuration file is included as
[`etc/puppet_es.conf.example`](etc/puppet_es.conf.example).
### Section: `base`
**`on_error`** (optional) What to do with the report file when we encounter a
parse error or an ElasticSearch error. Possible values:
* `delete` Delete the file off disk
* `archive` Move the file to the directory specified in `archive_dir`
* `ignore` Leave the file as-is (default)
**`on_success`** (optional) What to do with the report file after successfully
posting to ElasticSearch. Possible values:
* `delete` Delete the file off disk
* `archive` Move the file to the directory specified in `archive_dir`
* `ignore` Leave the file as-is (default)
**`archive_dir`** (conditionally required) The directory to move files into when
`archive` is set for `on_error` or `on_success`. Has no effect if neither of
those is set to `archive`, and is required if either is set to `archive`.
### Section: `elasticsearch`
**`host`** (required) The fully qualified domain name for connecting to
ElasticSearch over HTTP.
**`port`** (required) The port for connecting to ElasticSearch over HTTP.
### Section: `logging`
**`level`** (optional) What message level to log. Valid options are those
defined by the Python 2.7 `logging` module. Defaults to `WARNING`.
**`stderr`** (optional) Boolean value about whether to print log messages to
`stderr`. Defaults to `false`.
**`syslog`** (optional) Boolean value about whether to print log messages to
syslog. Defaults to `true`.
**`file`** (optional) Filename for a file to write log messages into. Defaults
to an empty value, meaning do not log to a file.
## Configuring ElasticSearch
An example ElasticSearch template that supports the format this script uses can
be found at [`etc/puppet_template.json`](etc/puppet_template.json).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
puppet_es-0.2.2.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for puppet_es-0.2.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c342a182997c3c5d04e3b83553563f867d099e50127491b3a451ebfa4aa4770f |
|
MD5 | 030d15f175fd739f3652261cd7f22997 |
|
BLAKE2b-256 | b95a0a11b21a4512d2101d9ea1a8d59b270bf43fa9f3d77edde199af3530f331 |